By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,240 Members | 782 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,240 IT Pros & Developers. It's quick & easy.

Ajax works fine Chrome but gives errors in IE*

P: 2
IE8 is giving me an Unknown Runtime Error, on the following line.
Expand|Select|Wrap|Line Numbers
  1.      document.getElementById("txtHint").innerHTML=xmlhttp.responseText; 
Here is the complete function.
Expand|Select|Wrap|Line Numbers
  1.  function showUser(str)
  2. {
  3. //str=document.getElementById("users").value;
  4. //alert(str);
  5.  
  6. if (str=="")
  7.   {
  8.   document.getElementById("txtHint").innerHTML="";
  9.   return;
  10.   } 
  11. if (window.XMLHttpRequest)
  12.   {// code for IE7+, Firefox, Chrome, Opera, Safari
  13.   xmlhttp=new XMLHttpRequest();
  14.   }
  15. else
  16.   {// code for IE6, IE5
  17.   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  18.   }
  19. xmlhttp.onreadystatechange=function()
  20.   {
  21.   if (xmlhttp.readyState==4 && xmlhttp.status==200)
  22.     {
  23.     document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  24.     }
  25.   }
  26. xmlhttp.open("GET","ajax_ldap.php?q="+str,true);
  27. xmlhttp.send();
Aug 30 '10 #1

✓ answered by SkyuVa

It turns out that the ajax page I was calling has a form in it. Which means that I was inserting a form into a form . Refer to the bottom following link for an in depth explanation.
http://www.tek-tips.com/viewthread.c...1425914&page=7

Share this Question
Share on Google+
1 Reply


P: 2
It turns out that the ajax page I was calling has a form in it. Which means that I was inserting a form into a form . Refer to the bottom following link for an in depth explanation.
http://www.tek-tips.com/viewthread.c...1425914&page=7
Aug 30 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.