奇怪的jQuery UI错误

esq*_*qew 1 jquery tabs jquery-ui

我正在尝试使用jQuery UI Tabs模块,但每当我尝试这样做时,我在控制台中出现以下错误:

Uncaught TypeError: Object #<an Object> has no method 'tabs'
Run Code Online (Sandbox Code Playgroud)

我按照演示的来源一直到信,我仍然无法让它工作.

我正在本地加载CSS和来自Google CDN的JS,Chrome的开发人员工具告诉我浏览器200 OK为每个JS和CSS文件添加了一个.

任何人都可以对此有所了解吗?

提前致谢!


根据请求,我还添加了我的代码:

<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>
Run Code Online (Sandbox Code Playgroud)

哎呀,忘了这部分代码:

<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">
Run Code Online (Sandbox Code Playgroud)

Tim*_*nks 9

我找到了你的问题.在您的jQuery UI脚本标记中,您有"type ='text/javasctipt'",其中"javascript"拼写错误.