我有这段代码(jQuery)。 基本上我想重新加载页面,如果有输入#SchoolName
存在,但它错过class="ac_input"
,如果该类存在,不要重新加载页面。 这可能吗?带条件的jquery重新加载页面
<input type="text" onfocus="showVal(this.value);" value="" id="SchoolName" size="30" maxlength="50" name="SchoolName" autocomplete="off" class="ac_input">
function autocomplete() {
$("#SchoolName").autocomplete("ajaxFuncs.php",{cacheLength:1,mustMatch:1,extraParams:{getSchoolName:1}});
};
$(document).ready(function(){
setTimeout("autocomplete()", 500);
// what do i have to add here???
});
不要传递一个字符串'setTimeout'。 – SLaks 2012-01-17 18:26:59