Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ajax not working with IE. Other browser are working fine.

    I have the following ajax code that is working fine in all browsers except ie. I don't get any error message. Does anyone know what is wrong?

    <script language="javascript">
    var xmlhttp;
    function showDispachers(str) {
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null) {
    alert ("Browser does not support HTTP Request");
    return;
    }
    var url="showDispachers.php";
    url=url+"?q="+str;
    url=url+"&sid="+Math.random();
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
    }

    function stateChanged() {
    if (xmlhttp.readyState==4) {
    document.getElementById("idDispacher").innerHTML=xmlhttp.responseText;
    }
    }

    function GetXmlHttpObject() {
    if (window.XMLHttpRequest) {
    // code for IE7+, Firefox, Chrome, Opera, Safari
    return new XMLHttpRequest();
    }
    if (window.ActiveXObject) {
    // code for IE6, IE5
    return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
    }
    </script>

    Thanks in advance

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    THis thread needs to be moved to the Ajax forum. Also Brenops, you need to use the code tags in your post to make your code readable.


  •  

    Tags for this Thread

    Posting Permissions

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