clicking anchor element within jquery tab loads new page *outside* tab

Posted by tabs_newbie on Stack Overflow See other posts from Stack Overflow or by tabs_newbie
Published on 2010-06-08T05:28:25Z Indexed on 2010/06/08 5:32 UTC
Read the original article Hit count: 287

Hello,

I would like to be able to click on an achor element from a page inside a jQuery tab and have that new page load directly inside the original tab. I used sample code from the jQuery tutorial page but to no avail!

When I click on the anchor tag, I get redirected to www.google.com but lose my tabs. Does anyone know what I'm doing wrong? would really appreciate it. Thanks!

$(document).ready(function(){
    $("#tabs").tabs();
});
$('#tabs').tabs({
    load: function(e, ui) {
        $('a', ui.panel).click(function() {
            $(ui.panel).load(this.href);
            return false;
        });
    }
});

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery