实现网页页面跳转的几种方法

今天总结了几种页面跳转的方法,分别是用meta标签实现、用javascript实现、用php实现,下面就来一一分享一下吧。

1、meta标签实现

只需在head里加上下面这一句就行了,在当前页面停留0.1秒后跳转到目标页面

<meta http-equiv=”refresh” content=”0.1; url=http://www.i7758.com/“>

2、Javascript实现

方法一:

这个方法比较常用

window.location.href = “http://www.i7758.com/“;

方法二:

self.location = “http://www.i7758.com/“;

方法三:

top.location = “http://www.i7758.com/“;

方法四:

只对IE系列浏览器有效,实用性不大

window.navigate(“http://www.i7758.com/“);

3、php实现

<?php

header(“Location: http://www.i7758.com/“);

?>

Ok,以上就是今天总结的几种页面跳转的方法了。

未经允许不得转载:爱前端网 » 实现网页页面跳转的几种方法

赞 (0) 打赏


觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏