Skip to content

Instantly share code, notes, and snippets.

@joeylin
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save joeylin/9661078 to your computer and use it in GitHub Desktop.

Select an option

Save joeylin/9661078 to your computer and use it in GitHub Desktop.
浏览器跳转对js调试的影响
<a class="no-href" href="">test</a>;
$('.no-href').on('click', function(){
// do some stuff
// some error happens
return false;
});
bug: 没有在href上面加内容时,会造成发生错误时候自动跳转,错误被忽略,偶尔会出现断点也无法跟踪的现象。
解决方法: 在href上面加个#使之不跳转。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment