0

im using the standard jquery tabs 1.3.2 to load a list of bookmarks in each tab pane.

If a tab is clicked before the dom is ready the ajax page is loaded by itself. I don't want that to happen so how can I stop that behavior?

 <ul id="tool-tabs" class="tabs clearfix">
 <li class="ui-tabs-selected"><a href="#tools">Tools</a></li>
 <li><a id="bookmarks" href="/ajax.bookmarks.php">Bookmarks</a></li>
 <li><a id="favorites" href="/ajax.favorites.php">Favorites</a></li>
 </ul>

If i click Bookmarks as the page loads i get the the ajax page loaded to /mysite/ajax.bookmarks.php which i don't want.

Thanks in advance.

4 Answers 4

2

Simplest thing is probably set the default style for the tab group to display: none, and then make it visible after the page is done loading. You could also trying adding a onClick="return false" to disable them and then clear those with jQuery once they're ready for use.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, its always the simplest things you overlook when you have a million things to finish.
0

try writing ur code inside

$(document).ready(function(){

//

});

Comments

0

Are you sure you are calling the tabs() function of jquery in the $(document).ready() method? If this is the case you should not have a problem.

Comments

0
$(document).ready(function(){
    //once dom get ready it happens
    $('#bookmarks').trigger('click');    
    $("#bookmarks").click(function(e){
        e.preventDefault();
    });     
});

Run your ajax codes and onsuccess of your ajax once again activate it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.