3
我收到以下錯誤,它顯示爲Javascript沒有解釋$符號。Uncaught TypeError:undefined不是Wordpress中的函數(匿名函數)
未捕獲的類型錯誤:未定義不是函數main.js:1 (匿名功能)main.js:1
附在下面是main.js代碼。這回工作很好。我試圖找出在哪裏尋找問題的指針,即主題,jquery導入等。歡迎任何建議。
$(function(){
var cardHeight = 0;
function _setCardHeight(){
$(".subpage-box").each(function(){ var current_height =
$(this).height();
cardHeight = (current_height > cardHeight) ? current_height :
cardHeight;
}); $(".subpage-box").each(function(){ if($(this).height() <
cardHeight){ $(this).height(cardHeight); } });
}
function _setNavStyle(){
$("menu-main-menu > li > a").each(function(){
var text = $(this).html();
if($(this).contains("for")){
}
});
}
_setNavStyle();
_setCardHeight();
});
感謝您的建議。由於相同功能在2周前開始工作,所以我只能想一想,如果Wrodpress(3.9.1)的更新現在可能導致此問題被破壞。還有一種機制(例如更新主題)以使其像以前一樣工作(即不需要對代碼進行任何更改)。 – Mythbuster
Sup,playaaaaaaaaaaaaaaaaaaa? –