1

I have a problem with my jquery UI tabs currently only in Firefox 3.6.24 where the first tab will not be loaded. It is driving me insane because the xhr says that it has the html data.

jQuery v1.4.4 jQuery v1.8.18

wondering if there are some known issues around this and any fixes

  $(function() {
            $("#tabs").tabs({
                'cookie': {
                        'expires': 1
                    },
                'ajaxOptions': {
                    'error': function( xhr, status, index, anchor ) {
                        $( anchor.hash ).html(
                            "Couldn't load this tab. We'll try to fix this as soon as possible.");
                    }
                },
                'spinner':"Loading..."
            });
        });

=====HTML=====

      <div id="tabs">
        <ul class="nav nav-tabs">
            <li><a href="/url/1">First tab</a></li>
            <li><a href="/url/2">Second tab</a></li>
            <li><a href="/url/3">Third tab</a></li>
            <li><a href="/url/4">Fourth tab</a></li>
        </ul>
     </div>

http://jsfiddle.net/Un2q4/1/

=====UPDATE=======

The problem was in the HTML the form element was being opened inside of a table and the form close tag was outside the close table tag. Lesson learned always validate your HTML.

BillPull
  • 6,853
  • 15
  • 60
  • 99
  • I am really confused how the question you linked me to relates to this issue. – BillPull Jun 15 '12 at 22:01
  • OK I confused myself with this one. The content of a tab doesn't load but the tabs appear, right? :) Time to take a break. I will be removing the Also the sample without something to load into it doesn't really show. I will be removing my comments soon, as they are in fact confusing here. Please think about some better sample. – Boro Jun 15 '12 at 22:54
  • yes the tabs show but the content doesnt load – BillPull Jun 18 '12 at 14:50
  • 3
    FF3.6 is an old browser. Let it die gracefully. – strah Jun 18 '12 at 15:21
  • Is the first tab every being loaded, e.g. after a second click or sth? Or it will just never ever load? – Boro Jun 18 '12 at 15:29
  • never be loaded the xhr seems to have the html in it. – BillPull Jun 18 '12 at 15:38
  • It actually turned out to just be a problem with the html being rendered shouldve just checked to see if the html was valid first but guess I had tunnel vision on the tabs. Anyways I will accept it because it could be helpful. – BillPull Nov 02 '12 at 15:26
  • mm my bad then asking to accept. Anyways.. feel free to unaccept and post the answer that worked for you. – Selvakumar Arumugam Nov 02 '12 at 15:30

1 Answers1

2

You need to include jQuery cookie plugin. See below note from jQuery UI site.

The cookie option requires the cookie plugin, which can be found in the development-bundle > external folder from the download builder.

You can find it in github -> https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js

Fixed fiddle: http://jsfiddle.net/skram/Un2q4/5/

Without cookie option and cookie plugin: http://jsfiddle.net/skram/Un2q4/6/

Selvakumar Arumugam
  • 79,297
  • 15
  • 120
  • 134
  • Cookie.js loaded I am starting to think there must be something in the html blocking it from being loaded but I cant post the HTML here mb if I clean it a bit will update soon. – BillPull Jun 18 '12 at 17:56