- 注册时间
- 2014-3-14
- 最后登录
- 2024-5-30
- 阅读权限
- 10
- 积分
- 506
- 精华
- 0
- 帖子
- 41
|
为了统一处理全局错误,我在boot.js中加入了ajaxComplete,请问这样处理可以吗?
代码如下:
//debugger
mini_debugger = false;
window.onload = function () {
$(document).ajaxComplete(function (evt, request, settings) {
var text = request.responseText;
var obj = mini.decode(text);
if (obj.error == -1 && typeof (obj.error) != "undefined") { alert(obj.message); if (obj.stackTrace == "timeout") { top.location = '../Default.aspx'; } }
})
}
//miniui
document.write('<script src="' + bootPATH + 'jquery-1.6.2.min.js" type="text/javascript"></sc' + 'ript>');
document.write('<script src="' + bootPATH + 'miniui/miniui.js" type="text/javascript" ></sc' + 'ript>');
document.write('<link href="' + bootPATH + 'miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />');
document.write('<link href="' + bootPATH + 'miniui/themes/icons.css" rel="stylesheet" type="text/css" />'); |
|