Javascript Ajax设置超时函数

Javascript Ajax设置超时函数,javascript,ajax,timeout,Javascript,Ajax,Timeout,我使用Ajax在keyup上提交表单 表单自动提交后,页面将显示结果 success: function (response){ $("#search_results<?php echo $HoursID ?>").html(response); setTimeout(response, 1500); 成功:功能(响应){ $(“#搜索结果”).html(回复); 设置超时(响应,1500); 这里的超时不起作用,我错过了什么?函数的正确用法是: success: fun

我使用Ajax在keyup上提交表单

表单自动提交后,页面将显示结果

success: function (response){
$("#search_results<?php echo $HoursID ?>").html(response);
setTimeout(response, 1500);    
成功:功能(响应){
$(“#搜索结果”).html(回复);
设置超时(响应,1500);

这里的超时不起作用,我错过了什么?

函数的正确用法是:

success: function(response){
  setTimeout(function(){
     $("#search_results<?php echo $HoursID ?>").html(response);
  }, 1500);
}
成功:功能(响应){
setTimeout(函数(){
$(“#搜索结果”).html(回复);
}, 1500);
}
有关更多信息,请参阅: