window.location和window.open做链接的区别
来源:互联网 发布:魔法王座弩炮升阶数据 编辑:程序博客网 时间:2024/05/16 10:57
用window.location和window.open做链接的区别
关键字:window.location window.open()
在给按钮、表格、单元格、下拉列表和DIV等做链接时一般都要用Javascript来完成,和做普通链接一样,可能我们需要让链接页面在当前窗口打开,也可能需要在新窗口打开,这时我们就可以使用下面两项之一来完成:
window.open 用来打开新窗口
window.location 用来替换当前页,也就是重新定位当前页
window.location 用来替换当前页,也就是重新定位当前页
我们可以用以下来个实例来测试一下。
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>引导页面</title> </script> </head> <body> <input type="button" value="新窗口打开" onclick="window.open('http://www.hao123.com')"> <input type="button" value="当前页打开" onclick="window.location='http://www.163.com'"> </body> </html>
0 0
- 用window.location和window.open做链接的区别
- 用window.location和window.open做链接的区别
- 用window.location和window.open做链接的区别
- 用window.location和window.open做链接的区别
- window.location和window.open做链接的区别
- window.location和window.open()的区别
- window.location.href 和 window.open 的区别
- window.location和window.open的区别[JavaScript]
- jquery 打开页面window.location和window.open的区别
- window.location和window.open的区别解析
- javascript 打开页面window.location和window.open的区别
- window.open和window.location.href的区别
- window.open和location.href区别
- 发现的window.open() 和location.href的区别。
- window.open 与openwindow.location的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- netty时间轮HashedWheelTimer
- 【Unity3D自学记录】批量创建预设(Prefabs)
- 2013-3-4 LoginServlet
- ubuntu memcached安装与配置
- 九度oj 题目1027:欧拉回路 【ZJU2008考研机试题2】
- window.location和window.open做链接的区别
- xcode不识别iOS设备,解决方法
- UVA 105 - The Skyline Problem(暴力枚举)
- shell 脚本中while 循环只执行一次的问题
- android源代码下载地址包含example
- 北邮1473
- linux tail命令
- HDU 3397 Sequence operation (区间合并 )
- 在 Centos 6.3 和 WinXP 下安装配置 OpenVPN 2.3.2 服务器和客户端