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

时间:2023-03-09 08:34:58
不知道哪里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)}};

这样浏览器会报错...就能定位到错误位置了.