Ajax setTimeout function



我正在使用ajax在键盘上提交表单。

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

success: function (response){
$("#search_results<?php echo $HoursID ?>").html(response);
setTimeout(response, 1500);    

此处的超时无法正常工作,我错过了什么?

setTimeout()函数的正确用法是:

success: function(response){
  setTimeout(function(){
     $("#search_results<?php echo $HoursID ?>").html(response);
  }, 1500);
}

有关更多信息,请查看:

https://www.w3schools.com/jsref/met_win_settimeout.asp

最新更新