Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:22:36+00:00 2026-05-15T23:22:36+00:00

I am using jQuery UI to build tabs on my page. That works well

  • 0

I am using jQuery UI to build tabs on my page. That works well until I add this following piece of code.

$(function () {
    $('#tabs').children("div").each(function (index) {
        $('#tabs').tabs('load', index);
    });
});

I’m trying to preload the tabs. What is interesting, is that if i run this through Firebug and put a breakpoint in that piece of code and step through, the code works perfectly. Otherwise the tabs are rendered, but the content within the tabs is not. This issue has been driving me crazy! Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:22:37+00:00Added an answer on May 15, 2026 at 11:22 pm

    If you look at the jQuery UI source for tabs the problem shows itself pretty fast, here’s the start of what happens when you call that load function:

    load: function(index) {
      index = this._getIndex(index);
      var self = this, o = this.options, a = this.anchors.eq(index)[0], 
                 url = $.data(a, 'load.tabs');
      this.abort();  //uh oh
    

    When you call load on a tab, the first thing it does is kill any other tabs running an AJAX call. So if you look at your page it is pre-loading the tabs, but only the last tab, because in a quick loop, each tab kills the previous one’s AJAX request.

    I think you’ll want to re-visit how you’re doing this as a whole, since the AJAX model is intended to load from the anchors (the <div> elements shouldn’t be there at all) I’m not sure exactly how your markup looks here.

    You have 2 options though, you can either do the AJAX loads yourself (better IMO), or use the built-in but do it sequentially, like this:

    $("#tabs").tabs({
      load: function(event, ui) {
        if(ui.index != $("#tabs a").length - 1) //not on the last tab
          $(this).tabs('load', ui.index + 1);   //load the next tab
      }
    }).tabs('load', 0);                         //kick off the first
    

    I don’t have a good environment to test the above, but we’re basically using the load event which fires when one tab finishes loading, then we start the next (so we never abort the one before in the loop). This is much slower, since we’re doing serial and not parallel requests…this is why for performance I recommend you make the .load() call yourself outside anything .tabs() offers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JQuery Tools Scrollable to build a full-page-width scrollable form, such that
I am using the jQuery plugin from the jQuery build of TinyMCE. This simplified
I'm using this jquery plugin to build forms. In order to allow the modification
I'm using some code to build up tables using JQuery, but in Firefox 3.5.3
I'm trying to build a site that runs without refreshes, using Jquery and PHP
I am using jquery plugin jstree to build a tree. When I execute this
I am trying to build a table using jQuery Datatables. Everything works on all
I have built two control containers on a page, one is using jquery-ui tabs
I'm trying to build an autocomplete using jQuery plugin autocomplete from this site .
I have to build a registration form using asp.net mvc 3 jquery validate. That

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.