English 中文(简体)
Ajax坠毁 IE 7
原标题:Ajax crashes IE 7

这是我的麻省法典。

function sendAjax(send_data,id)
{
    var ajaxobj;

    alert("After this alert problem occurs!");

    if (window.XMLHttpRequest) ajaxobj = new XMLHttpRequest();
    else ajaxobj = new ActiveXObject("Microsoft.XMLHTTP");

    ajaxobj.onreadystatechange=function()
    {
      if(ajaxobj.readyState==4) 
      {
          if(ajaxobj.responseText.match("confirmPage") != null) document.getElementById(id).innerHTML = ajaxobj.responseText;
          else  
          {
            if(id == "FreshContent") 
            document.getElementById(id).innerHTML = "<a id="refreshpage" onClick="siteSelection( select )">Failed.Click here to Reload!</a>";
            else
            document.getElementById(id).innerHTML = "<a id="refreshpage" onClick="sendAjax(0, latest_gossip_marquee );">Failed.Click here to Reload!</a>";
          }

          }
      else document.getElementById(id).innerHTML="Loading...."; 
    }

    if(id == "FreshContent") ajaxobj.open("GET","sitexyz.php?"+send_data,true);
    else ajaxobj.open("GET","html/xyz.html",true); 
    ajaxobj.send();     
}

Here the FreshContent is a div tag id.it works in opera & firefox but it crashes in my IE7. to see if the page returned by the server is valid the code checks if the returned page has confirmPage string in it.

问题回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签