我正在尝试使用jQuery UI Tabs模块,但每当我尝试这样做时,我的控制台都会出现以下错误:
Uncaught TypeError: Object #<an Object> has no method 'tabs'
我按照演示的来源直到这封信,我仍然无法让它工作。
我正在本地加载CSS和来自Google CDN的JS,Chrome的开发人员工具告诉我浏览器为每个JS和CSS文件获得200 OK
。
任何人都可以对此有所了解吗?
提前致谢!
根据请求,我还要添加我的代码:
<div id="tabs">
<ul>
<li><a href="#tabs-1">TrafficLight!</a></li>
<li><a href="#tabs-2">countr</a></li>
<li><a href="#tabs-3">Future projects</a></li>
</ul>
<div id="tabs-1">
<p><b>TrafficLight!</b> is an application that will temporarily turn your iPhone's screen red, yellow, or green. It's useful for providing instant, easy-to-understand feedback to anyone, especially a public speaker.</p>
<p><b><a href="#">Download on the App Store</a></b></p>
</div>
<div id="tabs-2">
<p><b>countr</b> is a basic counting application. You can use it to count baseball pitches, money, hats, anything!</p>
<p><b><a href="#">Download on the App Store</a></b></p>
</div>
<div id="tabs-3">
<p><i>Coming soon... ;)</i></p>
</div>
</div>
糟糕,忘了这部分代码:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javasctipt" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#tabs").tabs();
});
</script>
<link rel="stylesheet" href="jquery-ui-1.8.4.custom/css/ui-darkness/jquery-ui-1.8.4.custom.css">
答案 0 :(得分:9)
我找到了你的问题。在您的jQuery UI脚本标记中,您有“type ='text / javasctipt'”,其中“javascript”拼写错误。