<script type="text/javascript">
/**
* @param {String} errorMessage 错误信息
* @param {String} scriptURI 出错的文件
* @param {Long} lineNumber 出错代码的行号
* @param {Long} columnNumber 出错代码的列号
* @param {Object} errorObj 错误的详细信息,Anything
*/
window.onerror = function(errorMessage, scriptURI, lineNumber, columnNumber, errorObj) {
var msg = '';
var CRLF = String.fromCharCode(13) + String.fromCharCode(10);
msg += '错误信息:' + errorMessage + CRLF;
msg += '出错文件:' + scriptURI + '(' + lineNumber + ',' + columnNumber + ')' + CRLF;
msg += '错误详情:' + errorObj;
alert(msg);
}
</script>