MENU

跳转网页.html

March 27, 2019 • 源码公社

最近在搬站,为了让老站的流量转过来(因为无法直接301)所以做了一个跳转的代码,非常简洁明了。下面是食用方法,直接将代码直接保存为index.html就可以了。

<html lang="en">
<head>
<meta charset="UTF-8">
<title>5秒后跳转到另一个页面</title>
</head>
<script>
var t = 5;
var s = '.';
timeID=setInterval("countDown()",1000);
function countDown(){
time.innerHTML= t +"秒后跳转"+s;
t--;
s+='.';
if (t==0) {
location.href="https://htoo.vip/";;        //跳转目标网址
clearInterval(timeID);
}
}
</script>
<body>
<div><font ID="time" face="impact" color="#272822" size="7">即将跳转</font>
</div>
</body>
</html>

Last Modified: January 20, 2020
Archives Tip
QR Code for this page
Tipping QR Code
Leave a Comment