window.location和window.open()的区别
2009-09-04 09:15
405 查看
在给按钮、表格、单元格、下拉列表和DIV等做链接时可以使用JS实现,和做普通链接一样,可能我们需要让链接页面在当前窗口打开,也可能需要在新窗口打开,这时我们就可以使用下面两项之一来完成:
window.open 用来打开新窗口
window.location 用来替换当前页,也就是重新定位当前页
例如:<input type="button" value="新窗口打开" onclick="window.open('http://www.zhousl.com/')"> 为打开新窗口。
<input type="button" value="当前页打开" onclick="window.location='http://www.zhousl.com/'">为在当前页打开。
window.open 用来打开新窗口
window.location 用来替换当前页,也就是重新定位当前页
例如:<input type="button" value="新窗口打开" onclick="window.open('http://www.zhousl.com/')"> 为打开新窗口。
<input type="button" value="当前页打开" onclick="window.location='http://www.zhousl.com/'">为在当前页打开。
相关文章推荐
- window.location 与window.open的区别
- window.location.href和window.open的几种用法和区别
- window.open()与window.location()的区别
- jquery 打开页面window.location和window.open的区别
- 发现的window.open() 和location.href的区别。
- javascript中window.open()与window.location.href的区别
- window.location 与window.open区别
- javascript 打开页面window.location和window.open的区别
- window.location.href()与window.open()区别
- window.open 与openwindow.location的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- window.location和window.open的区别解析
- window.location与window.open()的区别 "top.location.href"是最外层的页面跳转
- window.location与window.open()的区别
- javascript 打开页面window.location.href和window.open的区别
- jquery 打开页面window.location和window.open的区别
- window.location.href和window.open的几种用法和区别
- javascript 打开页面window.location和window.open的区别
- window.location.href和window.open的几种用法和区别