-3
我有以下的jQuery功能:更改「jQuery的」功能「的jQuery WordPress的」功能
function lookup(inputString, divid, filename) {
if(inputString.length == 0) {
$('#'+divid).fadeOut(); // Hide the suggestions box
} else {
if (inputString.length > 2) {
$.post(filename, {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
$('#'+divid).fadeIn(); // Show the suggestions box
$('#'+divid).html(data); // Fill the suggestions box
});
}
}
}
它的工作很好,但我想在wordpress主題來使用它。任何想法如何改變功能,它可以用於wordpress?
爲什麼它不能在Wordperss中工作?只要確保你在Wordpress中包含JQuery ... – randomizer
它不是一個「jQuery」函數,它是一個使用jQuery庫的「JavaScript」函數。 – Cerbrus
這個問題不是「太寬泛」。第一個答案是正確的解決方案,所以它很好... – user1136199