Skip to main content

Search and Top Navigation

#3139 closed bug (worksforme)

Opened July 25, 2008 08:21PM UTC

Closed August 26, 2008 01:42PM UTC

Last modified October 11, 2012 09:15PM UTC

UI Tabs ajax call breaks when other ajax requests remove tabs element

Reported by: anonymous Owned by: klaus.hartl
Priority: major Milestone:
Component: ui.tabs Version: 1.5.2
Keywords: 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 add an if($(a.hash).is(":empty") around that line in the success and this seems to fix the problem.

success: function(r, s) {

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

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

}

...

}

Attachments (0)
Change History (4)

Changed August 17, 2008 10:12AM UTC by Cloudream comment:1

milestone: → TDB

Changed August 26, 2008 01:32PM UTC by klaus.hartl comment:2

Can you provide a test case? I wonder how this would break anything, because if $(a.hash) doesn't match anything, no html will be populated.

Changed August 26, 2008 01:42PM UTC by klaus.hartl comment:3

resolution: → worksforme
status: newclosed

I also wonder how Tabs should behave in such border case. Create a new div?

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:4

milestone: TBD

Milestone TBD deleted