实现网页页面跳转的几种方法(meta标签、js实现、php实现)_基础知识

WBOY
Release: 2016-05-16 16:47:33
Original
1249 people have browsed it

1、meta标签实现

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

复制代码代码如下:


2、Javascript实现

方法一:

这个方法比较常用

复制代码代码如下:

window.location.href = "http://jb51.net/";

方法二:

复制代码代码如下:

self.location = "http://jb51.net/";

方法三:

复制代码代码如下:

top.location = "http://jb51.net/";

方法四:

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

复制代码代码如下:

window.navigate("http://jb51.net/");

3、php实现

复制代码代码如下:

header("Location: http://jb51.net/");
?>

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!