[jQuery] waiting for a request to complete

2007-06-11 Thread Phil Glatz
Rob wrote: Where you're checking the request status you're creating a new request each time. You need to store the XHR object from the request and use that (untested): var xhr = $.post("/myhandler.php", params); while (xhr.status != 200); With Firefox 2, I'm getting this error: [Except

[jQuery] waiting for a request to complete

2007-06-11 Thread Phil Glatz
Rob suggested: > Alternatively you could use a globally accessibly variable which states > whether there is a pending request or not. > When a request is sent, set it true, when the response is received set > it false. Something like this? var pending = false; function send_message(msg) { pe

[jQuery] waiting for a request to complete

2007-06-11 Thread Phil Glatz
I'm calling $.post to send some text back to a web server, where it gets logged. The function is something like this: function send_message(msg) { var params = {}; params['my_message'] = msg; $.post("/myhandler.php", params); } It calls a php page that appends it to a log. If I view the lo