Help to rewrite jquery code

Is it possible to rewrite the code so that the links did not work only when you press the button ?

$('.tab_content').hide();
$('ul.tabs li:first').addClass("active").show();
$('.tab_content:first').show();
$('ul.tabs li').click(function () {
    $('ul.tabs li').removeClass("active");
    $(this).addClass("active");
    $('.tab_content').hide();
    var activeTab = $(this).find("a").attr("href");
    $(activeTab).fadeIn(200, function (event) {
        $(this).load($(this).attr("id") + ".php?" + Math.random());
    });
    return false;
});

Here is Example http://jsfiddle.net/Nazaret2005/zve79pk9/6/

I need it work like if Some one will go to http://mywebsite.com/tab1 (it will open and show them information + active tab1 button)

Now it work only by Click Button tab.

Thanks

The best way to achieve this perhaps is to use .htaccess on the server silently rewrite tab1 instead to a querystring such as ?tab=1 which would look something like this:

RewriteEngine On
RewriteRule ^tab\d+$ ?tab=$1

The good people in the Server Config forum can help you out with achieving that, after which we can revisit the JavaScript side of things.

Thanks for replay, but my problem was in JS. I correct my problem by myself, the problem that i don’t use window.location.hash; . now work ))) But thank any way … )))

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.