其他分享
首页 > 其他分享> > 检测网站的JS报错

检测网站的JS报错

作者:互联网

    window.onerror = function (errorMessage, scriptURI, lineNumber, columnNumber, errorObj) {
        var context = "错误路径:" + window.location.href + ";\n"
            + "错误信息:" + errorMessage + ";\n"
            + "出错文件:" + scriptURI + ";\n"
            + "出错行号:" + lineNumber + ";\n"
            + "出错列号:" + columnNumber + ";\n"
            + "错误详情:" + errorObj + "。\n";
        //获取到错误之后上传。
    }

 

标签:检测,errorMessage,JS,scriptURI,window,报错,出错,lineNumber,errorObj
来源: https://www.cnblogs.com/xinchenhui/p/11611510.html