JS 终止执行的方法

(一)在function里面
(1)return;
(2)return false;

(二)非function方法里面
alert("before error.");
throw SyntaxError();
alert("after error.");

(三)非function方法里面

 $("body").on("tap",".go-detail",function(e){

 e.preventDefault();
 e.stopPropagation();
}

posted @ 2017-11-05 23:17  17722857587  阅读(13872)  评论(0编辑  收藏  举报