Lasse Edsvik
Lasse Edsvik

Reputation: 9298

JQuery tabs link instead of ajax

I'm trying to put some tabs on a page that should go to a url when clicked on instead of toggle visibility.

I have this code:

$(function () {
        $('#tabs').tabs({
            selected: '0',
            select: function (event, ui) {
                var url = $.data(ui.tab, 'load.tabs');

                alert(url);

                if (url) {
                    location.href = url;
                    return false;
                }
                return true;
            }
        });
    });

url is "undefined" and it seems to do ajax-post. Whats needed to change in this:

<div id="tabs">
    <ul>
        <li><a href="#selectedTab">Test 1</a></li>
        <li><a href="someotherpage.htm">Test 2</a></li>
    </ul>...

Upvotes: 2

Views: 174

Answers (1)

Lasse Edsvik
Lasse Edsvik

Reputation: 9298

The answer was to have 0 instead of '0'

Upvotes: 2

Related Questions