/** * 全局设置(必须引用) * * @author jcl * @company yihu.com * @since 2014-12-22 */ $(document).ready(function() { //ajax全局设置 $.ajaxSetup({ cache : false, complete : function(XHR, TS) { var resText = XHR.responseText; var sessionstatus = XHR.getResponseHeader("sessionstatus"); var loginPath = XHR.getResponseHeader("loginPath"); if (911 == XHR.status && "timeout" == sessionstatus) { if (window.confirm('session timeout')) { window.location.replace(loginPath); } return; } } }); });