window.location和window.open的区别
2016-02-26 14:23
316 查看
http://blog.csdn.net/kiki113/article/details/4021483
window.location和window.open的区别
window.location = "http://www.baidu.com" 跳转后有后退功能
window.location.replace("http://www.baidu.com") 跳转后没有后退功能
window.open("http://www.baidu.com") 要新的窗口打开链接
<html> <head> <mce:script language="javascript"><!-- function old_page() { window.location = "http://www.baidu.com" } function replace() { window.location.replace("http://www.baidu.com") } function new_page() { window.open("http://www.baidu.com") } // --></mce:script> </head> <body> <input type="button" onclick="new_page()" value="new_page"/> <BR /> <input type="button" onclick="old_page()" value="old_page"/> <BR /> <input type="button" onclick="replace()" value="replace"/> </body>
window.location和window.open的区别
window.location = "http://www.baidu.com" 跳转后有后退功能
window.location.replace("http://www.baidu.com") 跳转后没有后退功能
window.open("http://www.baidu.com") 要新的窗口打开链接
相关文章推荐
- linux命令之uname
- linux bus driver device
- 每天一个linux命令(1):ls命令
- Linux/Unix下采用dlopen、dlsym、dlclose加载动态链接库
- nginx开发(一) 源码-编译
- corosync+drbd+mysql实现的高可用
- 嵌入式开发板iTOP4412学习开发板
- linux iptables 笔记
- docker的基础概念
- jenkins执行shell启动tomcat失败
- linux设备驱动归纳总结(八):4.总线热插拔
- CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)
- arm-2009q1-203-arm-none-linux-gnueabi.bin安装方法
- linux初学之1——虚拟机安装centos7
- OpenGL学习(1)
- .Net 大型分布式基础服务架构横向演变概述
- linux设备驱动归纳总结(八):3.设备管理的分层与面向对象思想
- 通过JS使用Twitter登录自己的网站
- tomcat-maven-plugin问题汇总
- linux设备驱动归纳总结(八):2.总线、设备和驱动的关系