我突然對這個page得到一個最不受歡迎的錯誤:jQuery的錯誤 - xyz是不是一個函數
Error: $("#accordion").accordion is not a function
我的jQuery代碼如下:
<script type="text/javascript">
$(function(){
// Accordion
$("#accordion").accordion({ header: "h4", autoHeight: false, collapsible: true });
//hover states on the static widgets
$('#dialog_link, ul#icons li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
// controls the sidebar navigation action
$('.interior #subContent > ul > li > a.drop').click(function(){
$(this).parent().children('ul').toggle("slow");
return false;
});
$(window).ready(function() {
$('li.products ul').show();
$('li.technical ul').show();
$('li.tips ul').show();
});
});
</script>
我已經好幾個星期工作,今天......錯誤。
我將不勝感激任何幫助確定錯誤的原因。
謝謝。
您是否意外刪除了jquery或jquery UI腳本? – Patricia 2010-02-04 14:59:20
@fmz - 我建議用Firefox的Firebug插件(http://getfirebug.com/)來查看你的網站,你可以使用「Net」標籤,它會顯示你得到了六個404錯誤,所以你確切知道哪個JavaScript文件未被加載。 – 2010-02-04 15:07:30
約翰,我使用螢火蟲,但忽略了網絡功能。謝謝你的提示。 – fmz 2010-02-04 17:14:21