JQuery Redirect to URL after specified time

前端 未结 9 937
感动是毒
感动是毒 2020-12-07 17:20

Is there a way to use JQuery to redirect to a specific URL after a give time period?

9条回答
  •  伪装坚强ぢ
    2020-12-07 18:00

    You could use the setTimeout() function:

    // Your delay in milliseconds
    var delay = 1000; 
    setTimeout(function(){ window.location = URL; }, delay);
    

提交回复
热议问题