View Single Post
Old 10-12-2007, 04:18 AM   PM User | #3
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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]
A1ien51 is offline   Reply With Quote