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 9065957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:37:55+00:00 2026-06-16T16:37:55+00:00

Having a large problem with jQuery Tabs. Im trying to load the tabs on

  • 0

Having a large problem with jQuery Tabs.

Im trying to load the tabs on my sites product page…
When the page loads i see that tabs content for a second (standard html tabs not ajax) then suddenly my whole website loads inside the tab.

i am using the standard code from the jquery ui tabs demo page.

<div id="productTabs">
    <ul>
        <li><a href="#tabDescription">Description</a></li>
        <li><a href="#tabSpecs">Specifications</a></li>
        <li><a href="#tabReviews">Reviews</a></li>
        <li><a href="#tabDownloads">Downloads</a></li>
    </ul>
    <div id="tabDescription">test</div>
    <div id="tabSpecs">test</div>
    <div id="tabReviews">test</div>
    <div id="tabDownloads">Sorry, no downloads available for this product.</div>
</div>
<script type="text/javascript">jQuery(document).ready(function(){jQuery("#productTabs").tabs();});</script>

But, i have a lot of other javascript around the site, just wondering if anyone has seen this before.

Many thanks

  • 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-06-16T16:37:56+00:00Added an answer on June 16, 2026 at 4:37 pm

    You are right, it’s the BASE meta tag. This is a problem you’ll face with the latest version of jQuery UI (1.9), it worked with 1.8. There were lot of changes to the Tabs API, but nothing seemed to cause this problem until you check the jQuery source code.

    1. The BASE meta tag instructs the browser to transform the href attribute in the tabs (that you use as reference for the tabs content) from hash+id to a full URL (using your BASE tag value). That’s the expected behavior.
    2. Previous versions of the Tabs UI would try hard to guess if the href was really remote or not, spliting the href tab value, then comparing it to the current URL AND to the BASE tag, then deciding if it was actually local.
    3. Latest version of jQuery doesn’t check the BASE tag value.
    4. So, the latest version, when used with BASE meta tag, will try to load the tab content using Ajax, reloading themselves (or whatever is in the BASE URL).

    This is what jQuery UI Tabs used in version 1.8.24:

        this.anchors.each(function( i, a ) {
          var href = $( a ).attr( "href" );
          // For dynamically created HTML that contains a hash as href IE < 8 expands
          // such href to the full page url with hash and then misinterprets tab as ajax.
          // Same consideration applies for an added tab with a fragment identifier
          // since a[href=#fragment-identifier] does unexpectedly not match.
          // Thus normalize href attribute...
          var hrefBase = href.split( "#" )[ 0 ],
            baseEl;
          if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] ||
              ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) {
            href = a.hash;
            a.href = href;
          }
    

    This is what jQuery UI Tabs uses in version 1.9.2:

        function isLocal( anchor ) {
          return anchor.hash.length > 1 &&
            anchor.href.replace( rhash, "" ) ===
              location.href.replace( rhash, "" )
                // support: Safari 5.1
                // Safari 5.1 doesn't encode spaces in window.location
                // but it does encode spaces from anchors (#8777)
                .replace( /\s/g, "%20" );
         }
    

    The code is organized differently because of the extensive rewriting of the Tabs code, but you can get the idea (The $( "base" )[ 0 ] is the BASE meta tag value).

    So far I haven’t found any way to tell the tabs "this is local, don’t use Ajax" using the normal tabs API. What I can offer you is what I did to quick fix it in the mean time (while I ask, recheck and maybe fill a bug report): a hack.

        function isLocal( anchor ) {
          return anchor.hash.length > 1 &&
            ( (anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" ).replace( /\s/g, "%20" )) ||
              (anchor.href.replace( rhash, "" ) === $( "base" )[ 0 ].href));
        }
    

    This is the newer version plus the check done in the previous version.

    In a non-minified copy of the latest jQuery UI, replace the isLocal function with that. Then minify the file. Replace the original version. Test.

    It worked for me in Firefox (17.0.1) and Chromium (18.0.1025.168).

    The disadvantage is that you cannot use a third-party copy (from a CDN). For me that is not a problem as most of my applications are used in intranets.

    If anybody finds a better solution or is aware of how to do it without hacking the jQuery UI code, please let us know.

    UPDATE: I found this bug report (with several duplicates): http://bugs.jqueryui.com/ticket/7822 I was tempted to add my own comment but it seems the jQuery developers won’t "fix" this as they consider the problem is elsewhere. Quote from the bugtracker:

    I don’t see how this is non-trivial to fix…

    Here’s the trivial, dynamic PHP implementation: ‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’] . ‘#foo’.

    It’s also fairly trivial to fix this in JavaScript, but I won’t provide sample code because that is the wrong place to be fixing this and should be highly discouraged. The behavior of links are clearly defined and consistent across all browsers. There is absolutely no reason people should be using incorrect URLs and then hacking around them in JavaScript.

    Finally, it’s important to note that "fixing" this would mean breaking the correct behavior for everyone who uses properly. Keep in mind that this was fixed because people with proper URLs were running into the real bug that existed in the old code.

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

Sidebar

Related Questions

I'm having a little problem, I have a header image that is quite large
Im having an interesting problem with reading a large file (~400 mb) that's on
I'm having a performance problem with filtering a large NSArray (19k items) for interactive
I am having a problem with the Document.SaveAs method in Word VBA with large
We're having a bizarre problem with Indy10 where two large strings (a few hundred
we're having this big problem with our application. It's a rather large application with
I'm having a problem with a MySQL UDF function ( mychem.sourceforge.net ) that's dependent
Hey all i am having some problems with loading an HTML page using jQuery's
I'm having a problem binding a dynamic event in jQuery. What I want to
I am having a problem whereby the scrollbars on my jquery dialog are not

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.