On the last line of this code an element DIV1 is being evaluated by getElementById(). How can I pass this as a variable parameter?
Statechanged() errors if you try to pass a parameter with it.
Thanks
Jeff Roehl
Statechanged() errors if you try to pass a parameter with it.
Thanks
Jeff Roehl
Code:
var xmlHttp
function showCustomer(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="[URL unfurl="true"]http://onionsalad.com/search.fwx";[/URL]
url=url+"?"+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("DIV1").innerHTML=xmlHttp.responseText;
}
}