<html>
<body>
<script type="text/javascript">
function DisplayComment(){
alert("请不要连续评论");
}
</script>
<a href="javascript:DisplayComment(); void(0);">测试</a>
</body>
</html>
解决方案 »
- 请教一下:asp中“缺少对象”问题
- ExtJs grid 导出问题
- JS -趣味系列:万物皆生灵--JavaScript之简单趣味体验
- <object data=editor.html ...> 浏览器不能显示的问题
- 昨天找了函数,能让页面滚动到该控件的位置,现在却找不到了,谁能给我?
- window.open()问题?
- 【急】雪地里跪求,在线等
- onmouseout事件丢失问题(在线等)
- 给定一个select中的任一个option的value值......
- 谁有将数字转化为大写形式人民币的javascript(yangtian)
- 表单的提交 引用方法
- 在没有div ID的情况下,如何才能将div分开?
<script language=javascript>function DisplayComment(){
if (true)alert("请不要连续评论");return; //不要false
alert('not run');
}</script>
<a href="javascript:DisplayComment();">链接</a> <!-- href 中也不用 return -->
if (true)alert("请不要连续评论");return; //不要false
alert('not run');
}</script>
<a href="javascript:DisplayComment();">链接</a>
<body>
<script type="text/javascript">
function DisplayComment(){
alert("请不要连续评论");
}
</script>
<a href="javascript:DisplayComment(); return false">测试</a>
</body>
</html>