Tag: onerror

window.onerror没有在Firefox中触发

我正在尝试创建一个javascript错误日志记录基础结构。 我正在尝试将window.onerror设置为我的error handling程序。 它适用于IE 6,但是当我在Firefox中运行它时,它遇到了一些冲突的onerror方法。 var debug = true; MySite.Namespace.ErrorLogger.prototype = { //My error handling function. //If it’s not in debug mode, I should get an alert telling me the error. //If it is, give a different alert, and let the browser handle the error. onError: function(msg, url, lineNo) { alert(‘onError: ‘ + msg); if […]