Hi all! Could anyone tell me why this wont work...
The function works when i remove the (ver) after "stateChanged" (inside showCat function). What I'm doing is I want to use this function more than once, so Im combining PHP to throw in a variable in showcat(str,ver). The ver is where the integer goes and auto-increments using a for loop that is being called through PHP
This is my PHP... (which works fine)..

<select name="blah" onchange="showCat(ver,$i)">
<option>blah</option>
</select>

... however the ajax wont work!

Please help!

<script type="text/javascript">
var xmlHttp

function showCat(str,ver)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getcat.php"
url=url+"?id="+str
xmlHttp.onreadystatechange=stateChanged(ver)
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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

function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
</script>