Skip to main content

Search and Top Navigation

#4587 closed feature (wontfix)

Opened June 09, 2009 04:05AM UTC

Closed October 22, 2010 08:25PM UTC

jQuery Tabs Do Not Update Browser's Location Bar

Reported by: zachstronaut Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.tabs Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

As you switch tabs when using the jQuery UI Tabs widget, the browser location bar stays on the same URI as when you hit the page. If you land on the page with the URI #tab2, and you are now viewing the 4th tab, the URI in the location bar will still say #tab2. This means that if you bookmark the page with default browser behavior, you will bookmark the wrong tab. It also makes it easy to copy and paste the wrong URI to somebody.

The fix is easy. If this is the default way to invoke the Tabs UI:


This is how to fix the bug above:


$('#tabs ul li a').click(function () {location.hash = $(this).attr('href');});

That second line need only be rolled into the UI code itself.

Attachments (0)
Change History (3)

Changed June 09, 2009 08:12AM UTC by jzaefferer comment:1

milestone: TBD1.8

Changed June 12, 2009 05:45AM UTC by klaus.hartl comment:2

type: bugfeature

History support is planned at some later stage.

Changed October 22, 2010 08:25PM UTC by scottgonzalez comment:3

resolution: → wontfix
status: newclosed

This should be done outside of the plugin to accommodate the application-specific hash tracking.