var Browser = new Object(); Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != - 1); Browser.isChrome = (navigator.userAgent.toLowerCase().indexOf("chrome") != - 1); if(Browser.isFirefox || Browser.isChrome){ window.constructor.prototype.__defineGetter__("event", __window_event); } function __window_event(){ return __window_event_constructor(); } function __event_srcElement(){ return this.target; } function __window_event_constructor(){ if(!(Browser.isFirefox || Browser.isChrome)){ return window.event; } var _caller = __window_event_constructor.caller; while(_caller!=null){ var _argument = _caller.arguments[0]; if(_argument){ var _temp = _argument.constructor; if(_temp.toString().indexOf("Event")!=-1){ return _argument; } } _caller = _caller.caller; } return null; } //异步请求子账户 var Imgrequest; var ImgAsynchres; var ImgcodeUrl; function ImgAsynchHttpReq(){ try{ Imgrequest = new XMLHttpRequest(); }catch(microsoft){ try { Imgrequest = new ActiveXObject("Msxml2.XMLHTTP"); }catch(othermicrosoft) { try{ Imgrequest = new ActiveXObject("Microsoft.XMLHTTP"); }catch(failed) { Imgrequest = false; } } } if (!Imgrequest){ alert("异步请求错误"); return; } //alert(Url); ImgAsynchres=null;//值空返回值 Imgrequest.open("POST", ImgcodeUrl, true); Imgrequest.onreadystatechange = changeImg; Imgrequest.send(null); } function changeImg(){ if (Imgrequest.readyState == 4){ if (Imgrequest.status == 200){ ImgAsynchres=Imgtrim(Imgrequest.responseText); document.getElementById('fujiama').src='/NCCB_Encoder/Encoder?CODE='+ImgAsynchres; return; } } } function Imgtrim(s){ var reg=/^(\s*)|(\s*)$/g; return s.replace(reg,""); }