var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } } function startRequest(){ createXMLHttpRequest(); try{ xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("GET", "http://mini.ufotown.cn/page/Cache/cache/FilterWords.html", true); xmlHttp.setRequestHeader("If-Modified-Since","0"); //禁止读取缓存(每次都发起一次请求),没有设置该值则会出现读取缓存的现象。 xmlHttp.send(null); }catch(exception){ alert("访问的文件不存在!"); } } var submitCount = 0; function handleStateChange(){ var flag = 0; if(xmlHttp.readyState == 4){ if (xmlHttp.status == 200 || xmlHttp.status == 0){ // 显示返回结果 var arrtext = new Array(); var content = document.frm_phone.fly_msg.value; content = ignoreSpaces(content); content = content.toLowerCase(); var text = xmlHttp.responseText; text = text.substr(0,text.length-1); arrtext = text.split("|"); for(var i=0; i 0) { alert("请求已经提交!"); //防止同一时间连续提交,导致连续扣费 return; } submitCount++; document.frm_phone.submit(); document.frm_phone.fly_msg.value = ""; } } } } function startRequestTimer(){ createXMLHttpRequest(); try{ xmlHttp.onreadystatechange = handleStateChange2; xmlHttp.open("GET", "http://mini.ufotown.cn/page/Cache/cache/FilterWords.html", true); xmlHttp.setRequestHeader("If-Modified-Since","0"); //禁止读取缓存(每次都发起一次请求),没有设置该值则会出现读取缓存的现象。 xmlHttp.send(null); }catch(exception){ alert("访问的文件不存在!"); } } function handleStateChange2(){ var flag = 0; if(xmlHttp.readyState == 4){ if (xmlHttp.status == 200 || xmlHttp.status == 0){ // 显示返回结果 var arrtext = new Array(); var content = document.frm_phone.fly_msg.value; content = ignoreSpaces(content); content = content.toLowerCase(); var text = xmlHttp.responseText; text = text.substr(0,text.length-1); arrtext = text.split("|"); for(var i=0; i