自动重定向到另一个HTML页面 [英] Auto-redirect to another HTML page
本文介绍了自动重定向到另一个HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使页面自动重定向到单独文件夹中的不同HTML文件的语法是什么?我所有的搜索都会返回如何从一个网站重定向到另一个网站。
< html>
< head>
< title>在2秒后将浏览器指向不同页面的网页< / title>
< meta http-equiv =refreshcontent =2; URL = http://example.com/services/computing/>
< meta name =keywordscontent =自动重定向>
< / head>
< body>
如果您的浏览器不会在几秒钟内自动转到那里,您可能需要
< a href =http://example.com/>目的地< / A>手动
。
< / body>
< / html>
...或者可以使用JavaScript完成。此JavaScript示例在4.5秒(4500毫秒)的延迟后在新的浏览器窗口中打开新网站:
<脚本language =javascripttype =text / javascript>
<! -
window.setTimeout('window.open(http://example.com/,newsite)',4500);
// - >
< / script>
What is the syntax for making a page auto-redirect to a different HTML file in a separate folder? All of my searching returns how to redirect from one website to another.
解决方案
One of these will work...
<html>
<head>
<title>A web page that points a browser to a different page after 2 seconds</title>
<meta http-equiv="refresh" content="2; URL=http://example.com/services/computing/">
<meta name="keywords" content="automatic redirection">
</head>
<body>
If your browser doesn't automatically go there within a few seconds,
you may want to go to
<a href="http://example.com/">the destination</a>
manually.
</body>
</html>
...or it can done with JavaScript. This JavaScript example opens the new site in a new browser window after a 4.5-second (4500 ms) delay:
<script language="javascript" type="text/javascript">
<!--
window.setTimeout('window.open("http://example.com/","newsite")',4500);
// -->
</script>
这篇关于自动重定向到另一个HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文