I’m having yet another wtf moment with jQuery.
I am importing the following files (among others)
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.ui.core.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.ui.tabs.min.js" type="text/javascript"></script>
html:
<div id="tabs">
<ul>
<li><a href="#tabs-1">test1</a></li>
<li><a href="#tabs-2">test2</a></li>
<li><a href="#tabs-3">test3</a></li>
</ul>
<div id="tabs-1">
<p>test1 content</p>
</div>
<div id="tabs-2">
<p>test2 content</p>
</div>
<div id="tabs-3">
<p>test3 content</p>
</div>
</div>
javascript:
$(document).ready(function() {
alert($("#tabs")); // '[object Object]'
alert($("#tabs").tabs) // 'undefined'
$("#tabs").tabs(); // doesn't work
alert('working'); // doesn't reach this line
});
I don’t really see how this can possibly be difficult, but I’ve still somehow managed to spend 2 hours without getting it working. Any ideas?
When I go to do a custom download for tabs only it says “Widget is a needed dependency of Tabs.”, so it looks like you need (if you haven’t yet) the widget code too.
Here it is minified: