AJAX

Moderators: None (Apply to moderate this forum)
Number of threads: 60
Number of posts: 100

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Ajax - Newbie queston regarding XMLHttpRequest Posted by Portishead850 on 23 Feb 2012 at 2:19 AM
In most examples I found on the Internet , I see something like this :


ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.myForm.time.value = ajaxRequest.responseText;
}
}

ajaxRequest.open("GET", "serverTime.php", true);
ajaxRequest.send(null);



How is it possible and how does this code work , when the "change state" property is checked
BEFORE
the open and send commands are executed ?
I know it works...but how does the flow return back to "check the state status" after the "open" and "send" are executed.

I would appreciate any help

Many thanks in advance



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.