Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Javascript not Executing in Safari 2



Hi all,
The following code does nothing in Safari, but it's fine in Firefox Mac. Any Ideas? It's supposed to be an AJAX call which executes via the "onselect" statement of a list-box option. ajaxDiv contains a "loading" icon.



Here it is:

//BEGIN JS CODE
function getForm(step,sel,contentDiv) {
var xmlHttp;
var url = "scripts/ajaxform.php?step=" + step + "&sel=" + sel ;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==1,2,3)
{
document.getElementById("ajaxDiv").style.visibility = "visible";
}
if(xmlHttp.readyState==4)
{
document.getElementById("ajaxDiv").style.visibility = "hidden";
document.getElementById(contentDiv).innerHTML = xmlHttp.responseText;
}
}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
// END JS CODE


Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.