Hi, I am running the following code on my website: function showHint2(str) { if (str.length==0) { document.getElementById("txtHint").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('course').innerHTML = xmlhttp.responseText; } } var params = []; params.push("q=" + str); params.push("u=" + document.getElementById("university").value); params.push("w=" + document.getElementById("university2").value); var url = "update-course.php?" + params.join("&"); infoStr = str+"&u="+document.getElementById('university').value+"&w="+document.getElementById('university2').value; xmlhttp.open("GET",url,true); xmlhttp.send(); } Code (markup): require_once('init.php'); //get the q parameter from URL $choice=$_GET["q"]; $uni=$_GET["u"]; $uni2=$_GET["w"]; if ($choice == 'Postgraduate'){ $year_of_study = "Postgraduate"; }else{ $year_of_study = "Undergraduate"; } if ($uni2 == '-1'){ $query = mysql_query("SELECT * FROM universities WHERE year_of_study = '$year_of_study' AND university = '$uni'"); }else{ $query = mysql_query("SELECT * FROM universities WHERE year_of_study = '$year_of_study' AND university = '$uni2'"); } while ($row = mysql_fetch_array($query)) { print "<option value='" . $row['course'] . "'>" . $row['course'] . "</option>"; } PHP: Which works fine on all browsers except IE. Does anyone have any ideas why this would not work on IE? Cheers, Adam
Is I.E showing a javascript error? If so, then what does the error say and what line... As far as I can tell, the code looks fine. The only thing I can think of is for you to declare xmlhttp at the start of your code (before function showHint2) like: var xmlhttp; Code (markup):