...

View Full Version : Ajax help



sandalwood
06-25-2006, 09:49 PM
Here's my working js:

var xmlHttp

function showMainCat(str)
{
var url="ajax_subCat.asp?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText
}
}


What I need to do is when showMainCat(str) is triggered, it sends 2 different html files to 2 different divs in the document.

rm-f
06-27-2006, 02:20 AM
xmlHttp => xmlHttp1 & xmlHttp2
stateChanged => stateChanged1 & stateChanged2

and so on

Kor
06-27-2006, 09:47 AM
http://www.devx.com/webdev/Article/28695



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum