function log(sev,msg) {
if (Math.random() > 0.1) return; // only log some errors
var img = new Image();
img.src = "log.php?sev=" +
encodeURIComponent(sev) +
"&msg=" + encodeURIComponent(msg);
}
处理无用的 window.error in undefined:0错误取决于您的站点体系结构,但是可以尝试识别所有 Ajax 调用,并在出现故障时抛出异常(可能使用 Stacktrace.js返回堆栈跟踪)。