Ticket #3181 (closed bug: invalid)
UI Tabs ajax call breaks when other ajax requests remove tabs element
| Reported by: | jhughes | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | plugin | Version: | 1.2.6 |
| Keywords: | ui tab | Cc: | |
| Blocking: | Blocked by: |
Description
The success function in the ajax call made by the ui tab code does not check to make sure the tab div still exists before populating the html. In our case if a user has made a second request which removed the tab element, the ajax call for the tab still returns and blows up the app. The offending code is the $(a.hash).html(r); call in the success function. I simply wrapped everything in the success function in an if($(a.hash) == null) and this seems to have fixed the problem.
success: function(r, s) {
if($(a.hash) == null) {
$(a.hash).html(r); cleanup();
... }
}
Change History
comment:2 Changed 5 years ago by flesler
- Status changed from new to closed
- Resolution set to invalid
This belongs to jQuery UI. Please repost this to the UI Bug Tracker.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

The success function in the ajax call made by the ui tab code does not check to make sure the tab div still exists before populating the html. In our case if a user has made a second request which removed the tab element, the ajax call for the tab still returns and blows up the app. The offending code is the $(a.hash).html(r); call in the success function. I simply wrapped everything in the success function in an if($(a.hash).is(":empty") and this seems to have fixed the problem.
success: function(r, s) {
}