您的位置:首页 > Web前端 > JavaScript

不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方window.alert=function(aa){ if (typeof (aa)"undefined"){ throw "就是这";}};

2017-10-31 17:40 543 查看
不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方

var oldalert=window.alert;

window.alert=function(aa){ if (typeof (aa)=="undefined"){ throw "就是这";}else{oldalert(aa)}};

这样浏览器会报错...就能定位到错误位置了.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐