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

不知道哪里alert undefined 用下面的语句是js报错.F12能提示报错的地方

var oldalert=window.alert;
window.alert=function(aa){ if (typeof (aa)=="undefined"){  throw "就是这";}else{oldalert(aa)}}; 这样浏览器会报错...就能定位到错误位置了.

原文地址:https://www.cnblogs.com/suizhikuo/p/7762713.html