Mike meinte:
> Hello,
> I have this:
> function process(a,b)
> {
> xmlHttp=GetXmlHttpObject();
> //alert(xmlHttp)
> if (xmlHttp==null)
> {
> alert ("Browser does not support HTTP Request");
> return
> }
> var url="http://www.xx.com/xxxxx/CheckEmailAddress.php"
> url=url+"?Email="+a+"&Password="+b
>
> xmlHttp.open("GET",url,true);
> xmlHttp.send(null);
> xmlHttp.onreadystatechange=stateChanged;
> }
>
> and I want to pass a and b to "stateChanged"
>
> but its not working as:
> xmlHttp.onreadystatechange=stateChanged(a,b); I'm getting a "type
> mismatch"
Because stateChanged() returns something else than a function.
You need something like
xmlHttp.onreadystatechange=function(a,b) {
return function() {
// have a and b available
};
}(a, b);
But this has been discussed here frequently.
Gregor
--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum