jsErrLogを使用してjsエラーを分析
740 ワード
1. github :
https://github.com/Offbeatmammal/jsErrLog/tree/master/src
2. jsErrLog, url
window.jsErrLog.url = "/jserr.html";
3. ajax
;(function(){
$(document).ajaxError(function(event, xhr, options){
var msg = [];
if(typeof xhr == "object"){
msg.push('status:' + xhr.status);
msg.push('statusText:' + xhr.statusText);
}
if(typeof options == "object"){
msg.push('url:' + options.url);
msg.push('data:' + options.data);
}
window.onerror('ajaxError:' + msg.join(';'));
});
})();