Opened 8 years ago

Closed 8 years ago

#7707 closed bug (worksforme)

Tabs: Incorrect documentation for 3.6 ...follow a tab's URL instead of loading its content via ajax

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

Description

It seems this feature does not work via http. If I browse straight to the file it functions as intended. I am trying to navigate page to page with out loading it via ajax. All of the pages are located in the same site/domain. The html is the same for the other page.

<!DOCTYPE html> <html> <head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>jQuery UI Example Page </title> <link type="text/css" href="css/south-street/jquery-ui-1.8.16.custom.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script> <script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript">

$(function () {

var tab_cookie_id = parseInt($.cookie("tab_cookie"))
0;

Tabs $('#tabs').tabs({

selected: tab_cookie_id, select: function (event, ui) {

var url = $.data(ui.tab, 'load.tabs');

if (url) {

$.cookie("tab_cookie", ui.index); location.href = url; return false;

} return true;

}

});

});

</script> <style type="text/css">

/*demo page css*/ body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px; background-color: #676767;} .demoHeaders { margin-top: 2em; } #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;} #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;} ul#icons {margin: 0; padding: 0;} ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;} ul#icons span.ui-icon {float: left; margin: 0 4px;}

</style>

</head> <body>

<h1>

Welcome to jQuery UI! Index</h1>

<!-- Tabs --> <h2 class="demoHeaders">

Tabs</h2>

<div id="tabs">

<ul>

<li><a href="index.html">Index</a></li> <li><a href="index1.html">Index 1</a></li>

</ul>

</div>

</body> </html>

Change History (5)

comment:1 Changed 8 years ago by Scott González

Milestone: 1.91.8.17
Resolution: fixed
Status: newclosed

Updated the docs.

comment:2 Changed 8 years ago by Scott González

Summary: 3.6 ...follow a tab's URL instead of loading its content via ajaxTabs: Incorrect documentation for 3.6 ...follow a tab's URL instead of loading its content via ajax

comment:3 Changed 8 years ago by spindlegoose

$(ui.tab).attr("href") gives the tab id and not the actual href so the browser does not move to the next page. It also is loading content on the first page twice.

comment:4 Changed 8 years ago by Scott González

Milestone: 1.8.171.9
Resolution: fixed
Status: closedreopened

ugh, sorry, I was testing against master.

comment:5 Changed 8 years ago by Scott González

Resolution: worksforme
Status: reopenedclosed

The documented code works fine for me: http://jsbin.com/onakan/edit#source

Note: See TracTickets for help on using tickets.