很多时候我在HTML页面中看到过像这样的链接:
<a href='#' onclick='someFunc(3.1415926); return false;'>Click here !</a>
Run Code Online (Sandbox Code Playgroud)
return false那里有什么影响?
而且,我通常不会在按钮中看到它.
这是指定的吗?在w3.org的某些规范中?
我对jQuery提交功能有一些疑问.
这是工作环境
jQuery:1.7.2,chrome(18.0.1025.168 m).
有两个问题.
第一名:
我的代码是这样的
HTML
<form id="test" action="..." method="post">
<input type="text" />
<input type="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
jQuery的
$('#test').submit(function(){
return false;
})
Run Code Online (Sandbox Code Playgroud)
问题是它在firefox和opera中工作得很好但是chrome.
2ST:
html:如上所述.
jQuery的:
$('#test').submit(function(){
if(...)
alert(something..);
return false;
})
Run Code Online (Sandbox Code Playgroud)
它不适用于firefox,opera和chrome.它总是触发form.submit为什么.
我很困惑.谁能想出来谢谢!