Ajax autoreferesh works fine with FireFox but doesn't work with IE
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Ajax autoreferesh works fine with FireFox but doesn't work with IE

Threaded View

  1. #1
    Join Date
    Nov 2008
    Posts
    1

    Ajax autoreferesh works fine with FireFox but doesn't work with IE

    hi I am using the following code for refreshing a div through ajax, it works fine FireFox but doesn't work at all with IE. Infact the function is called after every 10 seconds but it doesn't send the call to server while using IE. Can anyone will help me out please...

    Code:
    function startTimer(sessionId, jsPageRefreshInterval){
    param = "refreshInterval";
    
    // alert(param + " = " + refreshInterval + " = " + sessionId + " = " + jsPageRefreshInterval);
    try{
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }catch (e){
    // Internet Explorer
    try{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
    try{
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }catch (e){
    alert("Your browser does not support AJAX!");
    return false;
    }
    }
    }
    
    xmlHttp.open("GET","JobControllerUtilServlet?" + "sessionId=" + sessionId + "&paramChanged=true&param=" + param + "&value=" + refreshInterval, true);
    xmlHttp.onreadystatechange = function()
    {
    if(xmlHttp.readyState == 4 || xmlHttp.readyState=='complete')
    {
    document.getElementById('theTable').innerHTML = xmlHttp.responseText;
    dkc=setTimeout("startTimer('" + sessionId + "', '" + jsPageRefreshInterval + "');", 10000);
    return true;
    }
    }
    xmlHttp.send(null);
    }
    Last edited by PeejAvery; November 10th, 2008 at 01:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center