-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