javascript中window.open()与window.location.href的区别
window.open()
open() 方法用于打开一个新的浏览器窗口或查找一个已命名的窗口。
window.open(pageURL,name,parameters)
其中:pageURL 为子窗口路径
name 为子窗口句柄
parameters 为窗口参数(各参数用逗号分隔)
window.open("index.jsp",'top'); 只是表示打开这个页面,并不是打开并刷新index.aspx
window.location.href
表示重新定向到新页面,同时刷新打开的这个页面;
js页面的书写(案例)
self.location.href="/url" 当前页面打开URL页面
location.href="/url" 当前页面打开URL页面
windows.location.href="/url" 当前页面打开URL页面,前面三个用法相同。
this.location.href="/url" 当前页面打开URL页面
parent.location.href="/url" 在父页面打开新页面
top.location.href="/url" 在顶层页面打开新页面
个人总结
详细请看
http://blog.csdn.net/xiaobing_122613/article/details/72763569
想要体面生活,又觉得打拼辛苦;想要健康身体,又无法坚持运动。人最失败的,莫过于对自己不负责任,连答应自己的事都办不到,又何必抱怨这个世界都和你作对?人生的道理很简单,你想要什么,就去付出足够的努力。