网页的跳转在很多时候都非常的有用,下面的是两个简单的例子。仅供参考。
7 O4 J) ^! q# B. J" |方案一,用<meta>里直接写刷新语句:0 b% ]. u5 Z- p x
<html>3 ]; u8 g# P- d- N3 t8 g# a5 F
<head>
2 d' r' G* H! @3 m<meta http-equiv=content-language content=zh-cn>
; ?1 E/ ^- I# \% u8 R% F<meta http-equiv=content-type content=text/html; charset=utf8>- `' }0 E* m9 e1 ^
<meta http-equiv=refresh content=5;url=http://www.xinongda.com/search>
1 U8 g5 D# D0 r% X- l! D* U<title>html网页自动跳转代码--西农大网站</title>8 I @3 Q$ N2 `( R
</head>
" A# N0 k2 h/ G, o, @<body>
1 \" F9 @) a% M% o4 W$ ]测试:html网页自动跳转代码<br/>- O6 s! h1 F, Q7 h$ C
你可以在这里写下你想的一切东西!<br />0 v6 I+ |0 g" }. z) B
如:西北农林科技大学是一所985、211院校。<br />
+ s9 h, ?# E3 W' }</body>3 p2 P( ~; N! [+ j. k: m
</html>7 {7 B, w0 Z* y5 q9 P, ] G
方案二,用javascript脚本来跳转
. e9 A0 G# Y, i8 K7 p<html>0 ]; r0 L9 t5 h/ b/ E/ d
<head>
$ E. i& x0 ~/ S1 \8 }" J- j<meta http-equiv=content-type content=text/html; charset=utf8># c' \8 z+ k/ W' Y. {" v; ]* g
<title>正在进入西农大网站</title>! f e: ]: a5 \( |7 R
</head>
& L$ } m) \8 h5 `( l' a ~<body>6 F |4 Q2 z/ J' o# l/ {. D
<form name=loading>2 z- m/ P G# T3 N
<p align=center> <font color=#0066ff size=2>正在进入,请稍等</font><font color=#0066ff size=2 face=arial>...</font>! \7 u- `7 J( U% ^- Y2 @ o$ F
<input type=text name=chart size=46 style=font-family:arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;>
/ ?7 D, B; j3 y5 B<input type=text name=percent size=47 style=color:#0066ff; text-align:center; border-width:medium; border-style:none;>$ v- T& G" h G m0 w
<script> ; G8 J0 h- ]3 Z2 ^4 y" ?
var bar=0 1 P" A7 G% l. V" n' T
var line=|| : j, J, s# G' e4 _6 e, i
var amount=||
# m2 Q' o5 l& [" H# l% ?count()
. h; q# `& @4 U! @function count(){
1 ~8 E! U+ ]! m: Bbar=bar+2
2 e0 f4 v* J5 ]amount =amount + line 4 H, F/ Z5 `7 J+ \$ H" e
document.loading.chart.value=amount . Z" G- U& A5 E, e9 Q$ {
document.loading.percent.value=bar+% * N* ?* Y \8 Y; @5 |! Y- X8 a
if (bar<99)
7 }! S5 `2 N$ x/ C! J4 }{settimeout(count(),100);} 8 i2 j I5 q3 k4 ]- z
else
- H7 ]/ c. C0 f* y- t4 q" }% m q& G{window.location = ;}
$ c- S" }- _# E+ f& v}</script>
7 M. T% c8 T1 m5 ` </p>
' p# A" a; ?; Y+ E</form><p align=center>
3 k* U V: H" \7 H+ Z* \9 ]测试:html网页自动跳转代码<br/>
# m: n) K/ u3 G- n你可以在这里写下你想的一切东西!<br />3 R# i" {3 @# H. n! N/ X9 D# {) [! n
如:西北农林科技大学是一所985、211院校。<br /><br />+ X1 D$ u i5 M& w$ U$ K
如果您的浏览器不支持跳转,<a style=text-decoration: none href=. o' {" J+ u6 D0 ]( N
><font color=#ff0000>请点这里</font></a>.</p>, Y9 @9 I# {/ J, h7 Z. J
</body>
1 {+ m5 Y* O/ b1 q3 X0 `# j</html> m0 ~ d: a' a# ]+ Q1 B+ P
/ ]7 n" A' n+ ]9 X L
更多网页制作信息请查看: 网页制作 |
|