gogogo
管理员
管理员
  • UID25
  • 粉丝0
  • 关注0
  • 发帖数1377
阅读:2481回复:0

js终止程序执行的方法

楼主#
更多 发布于:2021-09-28 16:36
(一)在function里面
(1)return;     //vue 中  实践 无效
(2)
return false;    //有效

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


(三)非function方法里面
$("body").on("tap",".go-detail",function(e){
     e.preventDefault();
     e.stopPropagation();
}
游客


返回顶部