-
24 Oct 2010 6:22 PM #1
Aborting an Ajax request
Aborting an Ajax request
I originally mistakenly posted this under 3.0 help but I am actually using 2.0
I am wondering how does aborting an ajax request work internally, does it send another request to the server?
I am asking because I have a front end that is continuously refreshing a store by sending ajax request to my backend jsp with a certain set of parameters, without those parameters my back end jsp will crash, sometimes two consecutive store refreshes are too close to each other and it causes EXTJS to call abort on the first call, and for some reason, right after the abort call, my back end jsp receives a request that is WITHOUT any parameters...i am 99.999% sure that I don't have any code that's sending any requests without parameters, so my suspicion is with the abort call
any help is appreciated
thanks
-
24 Oct 2010 11:08 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
No, aborting a request only aborts the client-side request.
The server is not notified and will still try to send a reply (that will be ignored by the browser because the request has been aborted).
-
25 Oct 2010 5:39 AM #3
-
25 Oct 2010 5:41 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Requests without a parameter are usually caused by putting an autoLoad:true in a store and also using load().
-
25 Oct 2010 6:20 AM #5
-
25 Oct 2010 7:31 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
No it isn't... And no, aborting a request doesn't send another request...
So, nothing left but debugging. Put a breakpoint on Ext.data.Connection.request and look at the callstack to see what is causing it.
-
28 Oct 2010 12:04 PM #7
Condor,
I did try to debug it, and it seems if I set a breakpoint on that line, every request is fine. I even tried putting an alert box in the Ext.data.Connection.request function like this, and the all the requests are fine, they all have the proper parameters, looks like a timing issue?
Code:alert ('a little delay'); this.transId = Ext.lib.Ajax.request(method, url, cb, p, o);
-
28 Oct 2010 10:23 PM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Do NOT use alert() to debug (the extra wait this introduces changes the behaviour).
Use console.log() instead.
-
29 Oct 2010 5:39 AM #9
Similar Threads
-
What does aborting an ajax request do exactly?
By Chao in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 24 Oct 2010, 9:06 PM -
add a param to all Ext.Ajax.request (tree, store, normal Ajax.request)
By aj3423 in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 26 Jan 2010, 9:18 AM -
autoLoad vs Ext.Ajax.request... loadScripts not working w/Ajax.request
By zhegwood in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 6 Aug 2009, 3:28 PM -
Ajax.request removes port from request URL
By emkman in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 4 Aug 2008, 7:26 AM -
Aborting fileupload request
By wavel in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 28 Apr 2008, 6:31 AM


Reply With Quote