If I understand your goal correctly, you just need to call the function like this.
Code:
if(xmlhttp.status==200)
{
var str=xmlhttp.responseText;
var xml=xmlhttp.responseXML;
func(xml);
}
And the call is slightly modified from jkd's so the anonymous function takes a parameter.
Code:
window.onload=function(){
var x=4;
getReqObjPost("test.asp","",function(xml){doIt(xml,x)});
}
david_kw