Greetings. I'm stumped with a particular problem involving an ajax script that works for Firefox, Opera, Safari, and Chrome... but unfortunately does not work with any version of IE (*actually I haven't tested IE6 or less yet, but who cares about those anymore*).
On the HTML side, a list of hospitals is generated, and when a hospital is selected, the content changes, based on the selection. In addition, the script also runs 'onload' to generate the initial list. The script is below, and the incomplete example can be seen at http://www.aahcp.com/nusurvey.php
function narrowSelection(){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){alert("Browser does not support HTTP Request");return;}
var url="scripts/multiscript.php?narrowSelection="+document.getElementById('keyword').value;
xmlhttp.onreadystatechange=stateChangedA;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);}
function stateChangedA(){
if (xmlhttp.readyState==4){document.getElementById("hospitallist").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;}
Thanks in advance for any assistance!