Skip to main content

Bug Tracker

Side navigation

#3181 closed bug (invalid)

Opened July 23, 2008 09:59PM UTC

Closed July 25, 2008 12:08AM UTC

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:
Blocked by: Blocking:
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();

...

}

}

Attachments (0)
Change History (2)

Changed July 23, 2008 10:12PM UTC by jhughes comment:1

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) {

if($(a.hash).is(":empty")) {

$(a.hash).html(r); cleanup();

}

...

}

Changed July 25, 2008 12:08AM UTC by flesler comment:2

resolution: → invalid
status: newclosed

This belongs to jQuery UI.

Please repost this to the UI Bug Tracker.