| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe and Support WebmasterWorld|
|Do i need $.ajax async:false if using success: callback function?|
| 9:01 pm on Jun 6, 2012 (gmt 0)|
So i looked it up on the jQuery site and it said that As of jQuery 1.8, the use of async: false is deprecated. Why would it be depreciated?
I'm not sure i even need async:false, doesn't using a callback function as the success setting value negate the use of async:false?
| 6:10 am on Jun 8, 2012 (gmt 0)|
Provided the code following the ajax call does not rely on the completion of the ajax, the async:false can be removed, such code should be in the callback.
| 12:07 pm on Jun 8, 2012 (gmt 0)|
what's the idea behind async:false being depreciated anyway?
| 1:53 pm on Jun 8, 2012 (gmt 0)|
| 1:57 pm on Jun 8, 2012 (gmt 0)|
It's because synchronous requests can lock up the ajax state and browser. IMO it should been like this from the beginning and have the code serialize the ajax requests if necessary.
| 3:53 pm on Jun 8, 2012 (gmt 0)|
I changed all my scripts to remove the potential problem and every thing still works.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved