我想在特定时间后加载另一个 HTML 页面 [英] I want to load another HTML page after a specific amount of time

查看:13
本文介绍了我想在特定时间后加载另一个 HTML 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有动画图像的 html 页面form1.html".我想在 5 秒后加载另一个页面form2.html".我该怎么做?

I have one html page "form1.html" which has an animated image. I want to load another page "form2.html" after 5 seconds. How do I do this?

推荐答案

<script>
    setTimeout(function(){
        window.location.href = 'form2.html';
    }, 5000);
</script>

对于主页只添加'/'

<script>
    setTimeout(function(){
        window.location.href = '/';
    }, 5000);
</script>

这篇关于我想在特定时间后加载另一个 HTML 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆