Can I get JQuery tabs loading via ajax not to abort on tab switches?
-
27-10-2019 - |
Question
I'm using JQuery UI tabs loading content via ajax like this:
$('#tabsElem').tabs({ajaxOptions:{cache:false},
cache:true);
Consider this series of events:
- Tabs are displayed.
- A loading icon is shown while an ajax request is made.
- The user selects another tab.
- The ajax request hadn't returned yet so it is aborted.
- The user returns to the original tab.
- The tab's content is now empty and the ajax request will not be resent because of the caching.
I think you can see that last part is a problem. I've looked into a few options but nothing feels great yet. Any beautiful solutions out there?
Solution
Turns out the solution is to update your version of JQuery UI.
The results I described happen on version 1.8.6. On version 1.8.16 when you go back to the original tab the aborted ajax request is made again.
Thanks JQuery
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow