www.webdeveloper.com
Results 1 to 2 of 2

Thread: Js works in FF not IE

  1. #1
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865

    Js works in FF not IE

    I should probably know the tricks about javascript not working in IE etc. I'm sure this is something very basic. I just can't figure it out, and it's really not my strong suit.

    I'm testing it with IE8.

    IE is getting stuck on two of these ajax functions:
    --------- the error -----------
    Message: Unknown runtime error
    Line: 47
    Char: 5
    Code: 0
    ------------------------------
    Code:
    function blcode_search(blcode,asa_hash) {
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        document.getElementById("results").innerHTML=xmlhttp.responseText;
        }
      }
    xmlhttp.open("GET","search/blcode2serial.php?q="+blcode+"&asa_hash="+asa_hash+"",true);
    xmlhttp.send();
    }
    ----- These are the two lines that it's complaining about:
    document.getElementById("results").innerHTML=xmlhttp.responseText;
    document.getElementById("comparison_results").innerHTML=xmlhttp.responseText;


    Edit: I tried messing with the security settings and everything... IE is running in please exploit me mode.

  2. #2
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    It would help to see the all the associated markup, preferably a live URL.
    Could the new innerHTML be overwriting something critical?
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles