Hi Ricardo,
You need to evaluate the transport.readyState of the previous
Ajax.Request, and accordingly decide what you want to do.
Basically, 1|2|3 readyStates mean the the request is still in
progress. If you want to abort the old request, just call
myRequest.transport.abort(); and carry on
Instead of trying to keep the last reference to the XHR sent, just
enforce a singleton style approach, such that the user can't request a
refresh of data when a request is already pending.
function fireAjax(){
if(Ajax.activeRequestCount == 0)
new Ajax.Request(...);
}
prototype-scriptaculous@googlegroups.com
Sent: Tuesday, November 18, 2008 3:26 PM
Subject: [Proto-Scripty] Re: new AjaxRequest.
Instead of trying to keep the last reference to the XHR sent, just
enforce a singleton style approach, such that the user can't request a
refresh of data when
: Tuesday, November 18, 2008 3:26 PM
Subject: [Proto-Scripty] Re: new AjaxRequest.
Instead of trying to keep the last reference to the XHR sent, just
enforce a singleton style approach, such that the user can't request a
refresh of data when a request is already pending.
function
you can assign the request to a variable
myRequest = new Ajax.Request(..
- Original Message -
From: Manish [EMAIL PROTECTED]
To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Monday, November 17, 2008 9:09 AM
Subject: [Proto-Scripty] new