Compatibility issue : why my ajax sometime can run in IE, some time cannot ?

cruelo

New Member
By using AJAX on classic asp, I can create the select box of client, which when user select client_id, the page will display client information immediately without clicking any button. This code is working great in Chrome, safari. However for IE, sometimes it work, sometime it couldn't. And this make me confused. \[code\]<script type="text/javascript">function showActivity(str){var xmlhttp;if (str=="") { document.getElementById("txtHint1").innerHTML=""; return; } 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("txtHint1").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","activity_byclient.asp?q="+str,true);xmlhttp.send();}</script>\[/code\]I've tested on IE's console, it said "SCRIPT601: Unknown runtime error " which pointed me tothis line ..\[code\]document.getElementById("txtHint1").innerHTML=xmlhttp.responseText; \[/code\]I'm very beginner of this field so couldn't identify what wrong with this code. So could you please kindly help me. Thank you very much
 
Back
Top