JS 终止执行的方法

来源:互联网 发布:淘宝民族风女装品牌大全 编辑:程序博客网 时间:2024/05/21 11:35
(一)在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();
}

0 0