Newbie ajax question from this example:
How is xmlhttp.responseText assigned before xmlhttp.open() and xmlhttp.send() ? (If we need the data from demo_post.asp)
I understand it is in the onreadystatechange but if the javascript is read from top down I do not understand. Thanks, and go easy on me!
You need to look into closures.
onreadystatechange is getting assigned a function. That function is not called immediately…look at its name.