页面跳转的几种方法
来源:互联网 发布:键盘按键映射软件 编辑:程序博客网 时间:2024/05/28 16:29
通过js或者html或者php等动态程序都可以方便的实现跳转,这里搜集了几种页面跳转的方式
js方式的页面跳转
1.window.location.href方式
<script language="javascript" type="text/javascript">
window.location.href="http://www.dayanmei.com/";
</script>
2.window.navigate方式跳转
<script language="javascript">
window.navigate("top.jsp");
</script>
3.window.loction.replace方式实现页面跳转,注意跟第一种方式的区别
<script language="javascript">
window.location.replace("http://www.dayanmei.com");
</script>
有3个jsp页面(1.jsp, 2.jsp, 3.jsp),进系统默认的是1.jsp ,当我进入2.jsp的时候, 2.jsp里面用window.location.replace("3.jsp");与用window.location.href ("3.jsp");从用户界面来看是没有什么区别的,但是当3.jsp页面有一个"返回"按钮,调用window.history.go(-1); wondow.history.back();方法的时候,一点这个返回按钮就要返回2.jsp页面的话,区别就出来了,当用 window.location.replace("3.jsp");连到3.jsp页面的话,3.jsp页面中的调用 window.history.go(-1);wondow.history.back();方法是不好用的,会返回到1.jsp 。
4.self.location方式实现页面跳转,和下面的top.location有小小区别
<script language="JavaScript">
self.location='top.htm';
</script>
5.top.location
<script language="javascript">
top.location='xx.jsp';
</script>
6.不推荐这种方式跳转
<script language="javascript">
alert("返回");
window.history.back(-1);
</script>
在php程序中,这种方式跳转前面不能有任何输出
<?php
header("url.php");
?>
meta方式实现跳转(content = 3 单位是秒)
<meta http-equiv=refresh content=3;URL="http://www.dayanmei.com">
文章来自:老李的日志。源地址:http://www.dayanmei.com/blog.php/ID_815.htm
- 几种页面的跳转方法
- 页面跳转的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- C# 跳转页面的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- PHP页面跳转的几种方法
- jsp 页面跳转的几种方法
- servlet跳转页面的几种方法
- 页面跳转的几种方法
- servlet跳转页面的几种方法
- servlet跳转页面的几种方法
- php页面跳转的几种方法
- HTML5页面跳转的几种方法
- eclipse下tomcat的配置
- META标记用法大全
- 卸载USB设备时提示“正在使用”的解决办法
- ArcGIS Server 实时生成地图缓存
- svn的迁移及备份说明
- 页面跳转的几种方法
- 使用terracotta实现session共享的证实实验
- Windows XP下MinGW的安装与配置
- Oracle不完全恢复误删除的数据库表
- Enterprise Library Validation Application Block Step by Step (2)
- ref out params
- 常用数据库的自增字段创建方法汇总
- 大家好!
- 重载与重写