|
xmlHttp.onreadystatechange=stateChanged();
should be
xmlHttp.onreadystatechange=stateChanged;
when you use () that means to execute the code right here and now. You want to assign the reference to the function to the evet handler.
Since you are using a global variable to hold the xmlHttpRequest Object, you should use a global variable for the containerId.
Also the code should be
open
onreadystatechange
send
It gets around some browser bugs.
Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
|