使用jQuery延迟自动URL重定向? [英] Delay automatic url redirect with jquery?
本文介绍了使用jQuery延迟自动URL重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个过渡页面,该页面将显示2秒钟,然后自动重定向到主页.我该怎么做呢?我似乎无法耽误为我工作的时间.
I need a transition page that will display for 2 seconds before automatically redirecting to the home page. How do I do this? I can't seem to get delay to work for me.
推荐答案
You can just use setTimeout()
directly, like this:
setTimeout(function() {
window.location.href = "/NewPage.aspx";
}, 2000);
这篇关于使用jQuery延迟自动URL重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文