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:

  1. Tabs are displayed.
  2. A loading icon is shown while an ajax request is made.
  3. The user selects another tab.
  4. The ajax request hadn't returned yet so it is aborted.
  5. The user returns to the original tab.
  6. 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?

Was it helpful?

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
scroll top