window.onerror = function(msg, file, line){ var errorTxt = ""; errorTxt += "Error: " +msg+ "\n"; errorTxt += "Line: " +file+ "\n"; errorTxt += "Url: " +line+ "\n"; console.log(errorTxt); return false; //true表示是否需要弹出错误提示。false 不需要。 }
时间: 2024-10-22 14:25:36