且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

3 秒后重定向到主页

更新时间:2022-11-18 12:57:22

您可以使用 setTimeout 设置重定向用户的时间,并使用 window.location 设置应重定向用户的 URL

You can use setTimeout to set time after which user will be redirected and window.location to set the URL where the users should be redirected

setTimeout(function(){ window.location = "http://www.yoururl.com"; },3000);