+ -
当前位置:首页 → 问答吧 → 这个xmlhttp怎么回事?在ie正常,到ff提交就乱码!

这个xmlhttp怎么回事?在ie正常,到ff提交就乱码!

时间:2011-07-17

来源:互联网

这个代码怎么在ie正常,但是在FF浏览器,提交的内容都为乱码?
如何解决啊!!!

HTML code
function add(){  
var title=document.getElementsByName("title")[0].value;
  var  tao_xmlhttp; 
  if(window.ActiveXObject) 
  try{ 
      tao_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  }catch(e){ 
      try{ 
      tao_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
      }catch(e){ } 
  } 
if (!tao_xmlhttp && window.XMLHttpRequest){ 
    tao_xmlhttp = new XMLHttpRequest();} 

  if(!tao_xmlhttp) { 
  alert("你的IE版本太低,请您更新IE6以上版本"); 
  return; 
  } 
document.getElementById('tishi').innerHTML="正在载入..."; 
  tao_xmlhttp.onreadystatechange=function(e){ 
  if(tao_xmlhttp.readyState==4 && tao_xmlhttp.status==200) 
  document.getElementById('tishi').innerHTML=tao_xmlhttp.responseText; 
  } 
  tao_xmlhttp.open("Get","edit.asp?title="+title+"",true);          
  tao_xmlhttp.send(null); 
  }  

作者: chong6   发布时间: 2011-07-17

我就这个贴没有结,但为何结贴率这么低,我晕!

高手帮忙下,如何解决ff提交乱码的问题,然后我就结贴了!

作者: chong6   发布时间: 2011-07-17

自己解决了!

 tao_xmlhttp.open("Get","edit.asp?title="+escape(title)+"",true);  

加了 escape就好了!等待送分~~

作者: chong6   发布时间: 2011-07-17

恭喜!

作者: yaxiya   发布时间: 2011-07-17

热门下载

更多