Opened 10 years ago

Closed 10 years ago

#4487 closed bug (notabug)

tabs('length'); causes JS error on IE6/7/8

Reported by: mg Owned by:
Priority: major Milestone: 1.8
Component: ui.tabs Version: 1.7.1
Keywords: ie, tabs Cc: mg@…, mh@…
Blocked by: Blocking:

Description (last modified by Jörn Zaefferer)

This error occurs only on Internet Explorer (all versions). It happens when one tab existed in html prior to tabs initialization. Checking for length on one tab which wasn't added dynamically, but was present in html causes this js error:

Error message is:

"Line: 1281
Error: 'undefined' is null or not an object"

Debugger show the following call stack:


== 1. my code: ==

tabsObject.tabs('length');

== 2. jqueryui.js: ==

$.widget = function(name, prototype) {
...
		// handle getter methods
		if (isMethodCall && getter(namespace, name, options, args)) {
			'''var instance = $.data(this[0], name);'''

			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}
...

== 3. jquery.js ==

jQuery.extend({
	cache: {},

	data: function( elem, name, data ) {
		elem = elem == window ?
			windowData :
			elem;
'''
		var id = elem[ expando ];'''


== HTML code: ==

<div id="tabs">
	<ul class="tab-navi">
		<li><a href="#page-current">
<i class="tab-start"></i><strong>My-test-tab</strong>
<i class="tab-end"></i>
</a></li>

	</ul>
<div id="page-current">
...
</div>
</div>

== Tabs init: ==

self.tabsObject.tabs
		({
			spinner: self.tabLoader,

			tabTemplate: self.tabTemplate,

			cache: true
		});

Change History (4)

comment:1 Changed 10 years ago by Jörn Zaefferer

Milestone: 1.7.21.8

comment:2 Changed 10 years ago by Jörn Zaefferer

Description: modified (diff)

comment:3 Changed 10 years ago by Jörn Zaefferer

Description: modified (diff)

comment:4 Changed 10 years ago by Jörn Zaefferer

Priority: blockermajor
Resolution: invalid
Status: newclosed

Not reproducible. Please provide a testpage if the issue persists.

Note: See TracTickets for help on using tickets.