首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

AJAX有关问题:在IE中正常,但是在FF中显示不正常,请问!

2012-02-17 
AJAX问题:在IE中正常,但是在FF中显示不正常,请教! - Web 开发 / Ajaxfunction createxmlhttp(){var xmlhtt

AJAX问题:在IE中正常,但是在FF中显示不正常,请教! - Web 开发 / Ajax
function createxmlhttp()
{
  var xmlhttp = false;
  try{xmlhttp = new XMLHttpRequest;}
  catch(e)
  {try{xmlhttp =new ActiveXObject("MSXML2.XMLHTTP");}
  catch(e2){try{xmlhttp =new ActiveXObject("Microsoft.XMLHTTP");}
  catch(e3){xmlhttp = false;}}}
  return xmlhttp;


function channelbook(){
  var xmlhttp = createxmlhttp();
  xmlhttp.open("POST","bookmenu.txt",true);
  xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  xmlhttp.send(null);  
  xmlhttp.onreadystatechange=function(){
  if(xmlhttp.readystate==4)
  {if(xmlhttp.status==200)
  {document.getElementById("mainleft").innerHTML=xmlhttp.responseText;}
  else
  {document.getElementById("mainleft").innerHTML="对不起,您请求的页面有问题...";} }  
  else
  {document.getElementById("mainleft").innerHTML="加载中,请梢候...";}}  
}

以上是代码在IE中正常,但是在FF中显示“加载中,请梢候“,请高手指点

[解决办法]
你看一下这里第一楼的注释,
http://topic.csdn.net/u/20111204/11/65a6b767-7f53-48ec-8a64-c2fcba4d1f4f.html

热点排行