//显示浮层 postAjax:function(url,param,callback){ var loadScore = layer_.load(1,{shade: [0.8,'#393D49']}); var ciphertext = root.encrypt(JSON.stringify(param),$.cookie('token')); var isIE = !!window.ActiveXObject; var ieMode = document.documentMode; var isIE8 = isIE && ieMode == 8; if(isIE8){ var xdr = new XDomainRequest(); xdr.open("POST", root.IPLocation+url); xdr.onload = function(){ //Handle Response with xdr.responseText layer_.close(loadScore); var data = JSON.parse(xdr.responseText); if(data.result == true){ if(data.tokenExpired) { root.getTokenApply(function(data){ $.cookie('token',data); token=data; root.getJsonData(url,param,callback); }); }else{ callback(data.t); } }else{ if(data.msg!=''){ layer_.alert(data.msg); } } } xdr.send(ciphertext.toString()); }else{ $.ajax({ type: 'post', url:root.IPLocation+url, data: {info:ciphertext==""?"":ciphertext.toString()}, context: this, success:function(data) { layer_.close(loadScore); if(data.result == true){ if(data.tokenExpired) { root.getTokenApply(function(data){ $.cookie('token',data); token=data; root.getJsonData(url,param,callback); }); }else{ callback(data.t); } }else{ if(data.msg!=''){ layer_.alert(data.msg); } } },error:function(){ layer_.close(loadScore); layer_.alert("网络异常请稍后!"); } }); } },