信
51rgb
網頁自動跳轉頁面的代碼在很多時候都非常的有用,下面的是兩個簡單的例子。僅供參考。
方案一,用<meta>里直接寫刷新語句:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta http-equiv="refresh" content="5;url=http://www.51rgb.com">
<title>html網頁自動跳轉代碼--西農大網站</title>
</head>
<body>
測試:html網頁自動跳轉代碼<br/>
你可以在這里寫下你想的一切東西!<br />
如:西北農林科技大學是一所985、211院校。<br />
</body></html>
方案二,用javascript腳本來跳轉
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>正在進入西農大網站</title>
</head>
<body>
<form name=loading>
<p align=center> <font color="#0066ff" size="2">正在進入,請稍等</font><font color="#0066ff" size="2" face="Arial">...</font>
<input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">
<inputtype=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">
<script>
var bar=0
var line="||"
var amount="||"
count
function count{
bar=bar+2
amount =amount + line
document.loading.chart.value=amount
document.loading.percent.value=bar+"%"
if (bar<99)
{setTimeout("count",100);}
else
{window.location =http://www.51rgb.com;}
}</script>
</p>
</form><p align="center">
測試:html網頁自動跳轉代碼<br/>
你可以在這里寫下你想的一切東西!<br />
如:西北農林科技大學是一所985、211院校。<br /><br />
如果您的瀏覽器不支持跳轉,<astyle="text-decoration: none" ><font color="#FF0000">請點這里</font></a>.</p>
</body>
</html>
↓↓↓
法1:使用onclick事件
<input type="button" value="按鈕" onclick="javascrtpt:window.location. />
或者直接使用button標簽
<button onclick="window.location.>百度</button>
方法2:在button標簽外套一個a標簽
<a > <button>百度</button> </a>
或使用
<a ><input type="button" value='百度'></a>
方法3:使用JavaScript函數
*請認真填寫需求信息,我們會在24小時內與您取得聯系。