jquery 打开页面window.location和window.open的区别
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery 打开页面window.location和window.open的区别相关的知识,希望对你有一定的参考价值。
1.window.location是window对象的属性,而window.open是window对象的方法
window.location是你对当前浏览器窗口的URL地址对象的参考!
window.open是用来打开一个新窗口的函数!
2.window.open不一定是打开一个新窗口
只要有窗口的名称和window.open中第二个参数中的一样就会将这个窗口替换,用这个特性的话可以在iframe和frame中来代替location.href。
如
<iframe name="aa"></iframe>
<input type=button onclick="window.open('1.htm','aa','')">和
<input type=button
onclick="self.frames['aa'].location.href='1.htm'">的效果一样
3.在给按钮、表格、单元格、下拉列表和DIV等做链接时一般都要用Javascript来完成,和做普通链接一样,可能我们需要让链接页面在当前窗口打开,也可能需要在新窗口打开,这时我们就可以使用下面两项之一来完成:
window.open 用来打开新窗口
window.location 用来替换当前页,也就是重新定位当前页
可以用以下来个实例来测试一下。
<input type="button" value="新窗口打开" onclick="window.open('http://www.google.com')">
<input type="button" value="当前页打开" onclick="window.location='http://www.google.com/'">
4.window.location或window.open如何指定target?这是一个经常遇到的问题,特别是在用frame框架的时候
解决办法:
window.location 改为 top.location 即可在顶部链接到指定页
或
window.open("你的网址","_top");
5.window.open 用来打开新窗口
window.location 用来替换当前页,也就是重新定位当前页
用户不能改变document.location(因为这是当前显示文档的位置)。
window.location本身也是一个对象。
但是,可以用window.location改变当前文档 (用其它文档取代当前文档),而document.location不是对象。
服务器重定向后有可能使document.url变动,但window.location.href指的永远是访问该网页时用的URL.
大多数情况下,document.location和location.href是相同的,但是,当存在服务器重定向时,document.location包含的是已经装载的URL,而location.href包含的则是原始请求的文档的URL.
6.window.open()是可以在一个网站上打开另外的一个网站的地址
而window.location()是只能在一个网站中打开本网站的网页
window.open()详解
<script type="text/javascript"><!-- window.open ('page.html'); -->
</script>
因为着是一段javascripts代码,所以它们应该放在<SCRIPT LANGUAGE="javascript">标签和</script>之间。<!-- 和 -->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示出来。
要养成这个好习惯啊。
window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。这一段代码可以加入HTML的任意位置,<head>和</head>之间可以,<body>间</body>也可以,越前越早执行,尤其是页面代码长,又想使页面早点弹出就尽量往前放。
经过设置后的弹出窗口
下面再说一说弹出窗口的设置。只要再往上面的代码中加一点东西就可以了。 我们来定制这个弹出的窗口的外观,尺寸大小,弹出的位置以适应该页面的具体情况。
<SCRIPT LANGUAGE="javascript"><!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
-->
</SCRIPT>
参数解释:
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</SCRIPT>
用函数控制弹出窗口:
下面是一个完整的代码。
<html><head>
<script LANGUAGE="JavaScript">
<!--
function openwin()
window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //写成一行
//-->
</script>
</head>
<body onload="openwin()">
任意的页面内容...
</body>
</html>
这里定义了一个函数openwin(),函数内容就是打开一个窗口。在调用它之前没有任何用途。怎么调用呢?
方法一:<body onload="openwin()"> 浏览器读页面时弹出窗口;
方法二:<body onunload="openwin()"> 浏览器离开页面时弹出窗口;
方法三:用一个连接调用:
<a href="#" onclick="openwin()">打开一个窗口</a>
注意:使用的“#”是虚连接。
方法四:用一个按钮调用:
<input type="button" onclick="openwin()" value="打开窗口">
同时弹出两个窗口
对源代码稍微改动一下:
<script LANGUAGE="JavaScript"><!--
function openwin()
window.open ("page.html", "newwindow", "height=100, width=100, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=n o, status=no")//写成一行
window.open ("page2.html", "newwindow2", "height=100, width=100, top=1 00, left=100,toolbar=no, menubar=no, scrollbars=no, resizable=no, loca tion=no, status=no")//写成一行
//-->
</script>
为避免弹出的2个窗口覆盖,用top和left控制一下弹出的位置不要相互覆盖即可 。最后用上面说过的四种方法调用即可。
注意:2个窗口的name(newwindows和newwindow2)不要相同,或者干脆全部为空。
【主窗口打开文件1.htm,同时弹出小窗口page.html】
如下代码加入主窗口<head>区:
<script language="javascript"><!--
function openwin()
window.open("page.html","","width=200,height=200")
//-->
</script>
加入<body>区:
<a href="1.htm" onclick="openwin()">open</a>即可。
【弹出的窗口之定时关闭控制】
下面我们再对弹出的窗口进行一些控制,效果就更好了。如果我们再将一小段 代码加入弹出的页面(注意是加入page.html的HTML中,可不是主页面中,否则 ...),让它10秒后自动关闭是不是更酷了?
首先,将如下代码加入page.html文件的<head>区:
<script language="JavaScript">function closeit()
setTimeout("self.close()",10000) //毫秒
</script>
然后,再用<body onload="closeit()"> 这一句话代替page.html中原有的<BODY>这一句就可以了。(这一句话千万不要忘记写啊!这一句的作用是调用关闭窗 口的代码,10秒钟后就自行关闭该窗口。)
【在弹出窗口中加上一个关闭按钮】
<script><INPUT TYPE='BUTTON' VALUE='关闭' )
openwin()
document.cookie="popped=yes"
</script>
然后,用<body onload="loadpopup()">(注意不是openwin而是loadpop啊!)替换主页面中原有的<BODY>这一句即可。你可以试着刷新一下这个页面或重新进 入该页面,窗口再也不会弹出了。
注意:
1.window.location.Reload()和window.location.href=window.location.href;都是刷新当前页面。self.location.reload(); //也是刷新本页的意思;
2.用window.open()打开新页面,但是用window.location.href="" 却是在原窗口打开的.
有时浏览器会一些安全设置window.open肯定被屏蔽。例如避免弹出广告窗口。
参考技术A 1.window.location是window对象的属性,而window.open是window对象的方法window.location是对当前浏览器窗口的URL地址对象的参考!
window.open是用来打开一个新窗口的函数!
2.window.open不一定是打开一个新窗口!!!!!!!!
只要有窗口的名称和window.open中第二个参数中的一样就会将这个窗口替换,用这个特性的话可以在iframe和frame中来代替location.href。
如<iframe name="aa"></iframe>
<input type=button onclick="window.open('1.htm','aa','')">和
<input type=button
onclick="self.frames['aa'].location.href='1.htm'">的效果一样 参考技术B window.location一般是当前的页面跳转,window.open是新开tab页签打开,不会影响当前的页面。
JavaScript实现页面重载 - 535种方式
location = location
... and a 534 other ways to reload the page with JavaScript
- location = location
- location = location.href
- location = window.location
- location = self.location
- location = window.location.href
- location = self.location.href
- location = location[‘href‘]
- location = window[‘location‘]
- location = window[‘location‘].href
- location = window[‘location‘][‘href‘]
- location = window.location[‘href‘]
- location = self[‘location‘]
- location = self[‘location‘].href
- location = self[‘location‘][‘href‘]
- location = self.location[‘href‘]
- location.assign(location)
- location.replace(location)
- window.location.assign(location)
- window.location.replace(location)
- self.location.assign(location)
- self.location.replace(location)
- location[‘assign‘](location)
- location[‘replace‘](location)
- window.location[‘assign‘](location)
- window.location[‘replace‘](location)
- window[‘location‘].assign(location)
- window[‘location‘].replace(location)
- window[‘location‘][‘assign‘](location)
- window[‘location‘][‘replace‘](location)
- self.location[‘assign‘](location)
- self.location[‘replace‘](location)
- self[‘location‘].assign(location)
- self[‘location‘].replace(location)
- self[‘location‘][‘assign‘](location)
- self[‘location‘][‘replace‘](location)
- location.href = location
- location.href = location.href
- location.href = window.location
- location.href = self.location
- location.href = window.location.href
- location.href = self.location.href
- location.href = location[‘href‘]
- location.href = window[‘location‘]
- location.href = window[‘location‘].href
- location.href = window[‘location‘][‘href‘]
- location.href = window.location[‘href‘]
- location.href = self[‘location‘]
- location.href = self[‘location‘].href
- location.href = self[‘location‘][‘href‘]
- location.href = self.location[‘href‘]
- location.assign(location.href)
- location.replace(location.href)
- window.location.assign(location.href)
- window.location.replace(location.href)
- self.location.assign(location.href)
- self.location.replace(location.href)
- location[‘assign‘](location.href)
- location[‘replace‘](location.href)
- window.location[‘assign‘](location.href)
- window.location[‘replace‘](location.href)
- window[‘location‘].assign(location.href)
- window[‘location‘].replace(location.href)
- window[‘location‘][‘assign‘](location.href)
- window[‘location‘][‘replace‘](location.href)
- self.location[‘assign‘](location.href)
- self.location[‘replace‘](location.href)
- self[‘location‘].assign(location.href)
- self[‘location‘].replace(location.href)
- self[‘location‘][‘assign‘](location.href)
- self[‘location‘][‘replace‘](location.href)
- window.location = location
- window.location = location.href
- window.location = window.location
- window.location = self.location
- window.location = window.location.href
- window.location = self.location.href
- window.location = location[‘href‘]
- window.location = window[‘location‘]
- window.location = window[‘location‘].href
- window.location = window[‘location‘][‘href‘]
- window.location = window.location[‘href‘]
- window.location = self[‘location‘]
- window.location = self[‘location‘].href
- window.location = self[‘location‘][‘href‘]
- window.location = self.location[‘href‘]
- location.assign(window.location)
- location.replace(window.location)
- window.location.assign(window.location)
- window.location.replace(window.location)
- self.location.assign(window.location)
- self.location.replace(window.location)
- location[‘assign‘](window.location)
- location[‘replace‘](window.location)
- window.location[‘assign‘](window.location)
- window.location[‘replace‘](window.location)
- window[‘location‘].assign(window.location)
- window[‘location‘].replace(window.location)
- window[‘location‘][‘assign‘](window.location)
- window[‘location‘][‘replace‘](window.location)
- self.location[‘assign‘](window.location)
- self.location[‘replace‘](window.location)
- self[‘location‘].assign(window.location)
- self[‘location‘].replace(window.location)
- self[‘location‘][‘assign‘](window.location)
- self[‘location‘][‘replace‘](window.location)
- self.location = location
- self.location = location.href
- self.location = window.location
- self.location = self.location
- self.location = window.location.href
- self.location = self.location.href
- self.location = location[‘href‘]
- self.location = window[‘location‘]
- self.location = window[‘location‘].href
- self.location = window[‘location‘][‘href‘]
- self.location = window.location[‘href‘]
- self.location = self[‘location‘]
- self.location = self[‘location‘].href
- self.location = self[‘location‘][‘href‘]
- self.location = self.location[‘href‘]
- location.assign(self.location)
- location.replace(self.location)
- window.location.assign(self.location)
- window.location.replace(self.location)
- self.location.assign(self.location)
- self.location.replace(self.location)
- location[‘assign‘](self.location)
- location[‘replace‘](self.location)
- window.location[‘assign‘](self.location)
- window.location[‘replace‘](self.location)
- window[‘location‘].assign(self.location)
- window[‘location‘].replace(self.location)
- window[‘location‘][‘assign‘](self.location)
- window[‘location‘][‘replace‘](self.location)
- self.location[‘assign‘](self.location)
- self.location[‘replace‘](self.location)
- self[‘location‘].assign(self.location)
- self[‘location‘].replace(self.location)
- self[‘location‘][‘assign‘](self.location)
- self[‘location‘][‘replace‘](self.location)
- window.location.href = location
- window.location.href = location.href
- window.location.href = window.location
- window.location.href = self.location
- window.location.href = window.location.href
- window.location.href = self.location.href
- window.location.href = location[‘href‘]
- window.location.href = window[‘location‘]
- window.location.href = window[‘location‘].href
- window.location.href = window[‘location‘][‘href‘]
- window.location.href = window.location[‘href‘]
- window.location.href = self[‘location‘]
- window.location.href = self[‘location‘].href
- window.location.href = self[‘location‘][‘href‘]
- window.location.href = self.location[‘href‘]
- location.assign(window.location.href)
- location.replace(window.location.href)
- window.location.assign(window.location.href)
- window.location.replace(window.location.href)
- self.location.assign(window.location.href)
- self.location.replace(window.location.href)
- location[‘assign‘](window.location.href)
- location[‘replace‘](window.location.href)
- window.location[‘assign‘](window.location.href)
- window.location[‘replace‘](window.location.href)
- window[‘location‘].assign(window.location.href)
- window[‘location‘].replace(window.location.href)
- window[‘location‘][‘assign‘](window.location.href)
- window[‘location‘][‘replace‘](window.location.href)
- self.location[‘assign‘](window.location.href)
- self.location[‘replace‘](window.location.href)
- self[‘location‘].assign(window.location.href)
- self[‘location‘].replace(window.location.href)
- self[‘location‘][‘assign‘](window.location.href)
- self[‘location‘][‘replace‘](window.location.href)
- self.location.href = location
- self.location.href = location.href
- self.location.href = window.location
- self.location.href = self.location
- self.location.href = window.location.href
- self.location.href = self.location.href
- self.location.href = location[‘href‘]
- self.location.href = window[‘location‘]
- self.location.href = window[‘location‘].href
- self.location.href = window[‘location‘][‘href‘]
- self.location.href = window.location[‘href‘]
- self.location.href = self[‘location‘]
- self.location.href = self[‘location‘].href
- self.location.href = self[‘location‘][‘href‘]
- self.location.href = self.location[‘href‘]
- location.assign(self.location.href)
- location.replace(self.location.href)
- window.location.assign(self.location.href)
- window.location.replace(self.location.href)
- self.location.assign(self.location.href)
- self.location.replace(self.location.href)
- location[‘assign‘](self.location.href)
- location[‘replace‘](self.location.href)
- window.location[‘assign‘](self.location.href)
- window.location[‘replace‘](self.location.href)
- window[‘location‘].assign(self.location.href)
- window[‘location‘].replace(self.location.href)
- window[‘location‘][‘assign‘](self.location.href)
- window[‘location‘][‘replace‘](self.location.href)
- self.location[‘assign‘](self.location.href)
- self.location[‘replace‘](self.location.href)
- self[‘location‘].assign(self.location.href)
- self[‘location‘].replace(self.location.href)
- self[‘location‘][‘assign‘](self.location.href)
- self[‘location‘][‘replace‘](self.location.href)
- location[‘href‘] = location
- location[‘href‘] = location.href
- location[‘href‘] = window.location
- location[‘href‘] = self.location
- location[‘href‘] = window.location.href
- location[‘href‘] = self.location.href
- location[‘href‘] = location[‘href‘]
- location[‘href‘] = window[‘location‘]
- location[‘href‘] = window[‘location‘].href
- location[‘href‘] = window[‘location‘][‘href‘]
- location[‘href‘] = window.location[‘href‘]
- location[‘href‘] = self[‘location‘]
- location[‘href‘] = self[‘location‘].href
- location[‘href‘] = self[‘location‘][‘href‘]
- location[‘href‘] = self.location[‘href‘]
- location.assign(location[‘href‘])
- location.replace(location[‘href‘])
- window.location.assign(location[‘href‘])
- window.location.replace(location[‘href‘])
- self.location.assign(location[‘href‘])
- self.location.replace(location[‘href‘])
- location[‘assign‘](location[‘href‘])
- location[‘replace‘](location[‘href‘])
- window.location[‘assign‘](location[‘href‘])
- window.location[‘replace‘](location[‘href‘])
- window[‘location‘].assign(location[‘href‘])
- window[‘location‘].replace(location[‘href‘])
- window[‘location‘][‘assign‘](location[‘href‘])
- window[‘location‘][‘replace‘](location[‘href‘])
- self.location[‘assign‘](location[‘href‘])
- self.location[‘replace‘](location[‘href‘])
- self[‘location‘].assign(location[‘href‘])
- self[‘location‘].replace(location[‘href‘])
- self[‘location‘][‘assign‘](location[‘href‘])
- self[‘location‘][‘replace‘](location[‘href‘])
- window[‘location‘] = location
- window[‘location‘] = location.href
- window[‘location‘] = window.location
- window[‘location‘] = self.location
- window[‘location‘] = window.location.href
- window[‘location‘] = self.location.href
- window[‘location‘] = location[‘href‘]
- window[‘location‘] = window[‘location‘]
- window[‘location‘] = window[‘location‘].href
- window[‘location‘] = window[‘location‘][‘href‘]
- window[‘location‘] = window.location[‘href‘]
- window[‘location‘] = self[‘location‘]
- window[‘location‘] = self[‘location‘].href
- window[‘location‘] = self[‘location‘][‘href‘]
- window[‘location‘] = self.location[‘href‘]
- location.assign(window[‘location‘])
- location.replace(window[‘location‘])
- window.location.assign(window[‘location‘])
- window.location.replace(window[‘location‘])
- self.location.assign(window[‘location‘])
- self.location.replace(window[‘location‘])
- location[‘assign‘](window[‘location‘])
- location[‘replace‘](window[‘location‘])
- window.location[‘assign‘](window[‘location‘])
- window.location[‘replace‘](window[‘location‘])
- window[‘location‘].assign(window[‘location‘])
- window[‘location‘].replace(window[‘location‘])
- window[‘location‘][‘assign‘](window[‘location‘])
- window[‘location‘][‘replace‘](window[‘location‘])
- self.location[‘assign‘](window[‘location‘])
- self.location[‘replace‘](window[‘location‘])
- self[‘location‘].assign(window[‘location‘])
- self[‘location‘].replace(window[‘location‘])
- self[‘location‘][‘assign‘](window[‘location‘])
- self[‘location‘][‘replace‘](window[‘location‘])
- window[‘location‘].href = location
- window[‘location‘].href = location.href
- window[‘location‘].href = window.location
- window[‘location‘].href = self.location
- window[‘location‘].href = window.location.href
- window[‘location‘].href = self.location.href
- window[‘location‘].href = location[‘href‘]
- window[‘location‘].href = window[‘location‘]
- window[‘location‘].href = window[‘location‘].href
- window[‘location‘].href = window[‘location‘][‘href‘]
- window[‘location‘].href = window.location[‘href‘]
- window[‘location‘].href = self[‘location‘]
- window[‘location‘].href = self[‘location‘].href
- window[‘location‘].href = self[‘location‘][‘href‘]
- window[‘location‘].href = self.location[‘href‘]
- location.assign(window[‘location‘].href)
- location.replace(window[‘location‘].href)
- window.location.assign(window[‘location‘].href)
- window.location.replace(window[‘location‘].href)
- self.location.assign(window[‘location‘].href)
- self.location.replace(window[‘location‘].href)
- location[‘assign‘](window[‘location‘].href)
- location[‘replace‘](window[‘location‘].href)
- window.location[‘assign‘](window[‘location‘].href)
- window.location[‘replace‘](window[‘location‘].href)
- window[‘location‘].assign(window[‘location‘].href)
- window[‘location‘].replace(window[‘location‘].href)
- window[‘location‘][‘assign‘](window[‘location‘].href)
- window[‘location‘][‘replace‘](window[‘location‘].href)
- self.location[‘assign‘](window[‘location‘].href)
- self.location[‘replace‘](window[‘location‘].href)
- self[‘location‘].assign(window[‘location‘].href)
- self[‘location‘].replace(window[‘location‘].href)
- self[‘location‘][‘assign‘](window[‘location‘].href)
- self[‘location‘][‘replace‘](window[‘location‘].href)
- window[‘location‘][‘href‘] = location
- window[‘location‘][‘href‘] = location.href
- window[‘location‘][‘href‘] = window.location
- window[‘location‘][‘href‘] = self.location
- window[‘location‘][‘href‘] = window.location.href
- window[‘location‘][‘href‘] = self.location.href
- window[‘location‘][‘href‘] = location[‘href‘]
- window[‘location‘][‘href‘] = window[‘location‘]
- window[‘location‘][‘href‘] = window[‘location‘].href
- window[‘location‘][‘href‘] = window[‘location‘][‘href‘]
- window[‘location‘][‘href‘] = window.location[‘href‘]
- window[‘location‘][‘href‘] = self[‘location‘]
- window[‘location‘][‘href‘] = self[‘location‘].href
- window[‘location‘][‘href‘] = self[‘location‘][‘href‘]
- window[‘location‘][‘href‘] = self.location[‘href‘]
- location.assign(window[‘location‘][‘href‘])
- location.replace(window[‘location‘][‘href‘])
- window.location.assign(window[‘location‘][‘href‘])
- window.location.replace(window[‘location‘][‘href‘])
- self.location.assign(window[‘location‘][‘href‘])
- self.location.replace(window[‘location‘][‘href‘])
- location[‘assign‘](window[‘location‘][‘href‘])
- location[‘replace‘](window[‘location‘][‘href‘])
- window.location[‘assign‘](window[‘location‘][‘href‘])
- window.location[‘replace‘](window[‘location‘][‘href‘])
- window[‘location‘].assign(window[‘location‘][‘href‘])
- window[‘location‘].replace(window[‘location‘][‘href‘])
- window[‘location‘][‘assign‘](window[‘location‘][‘href‘])
- window[‘location‘][‘replace‘](window[‘location‘][‘href‘])
- self.location[‘assign‘](window[‘location‘][‘href‘])
- self.location[‘replace‘](window[‘location‘][‘href‘])
- self[‘location‘].assign(window[‘location‘][‘href‘])
- self[‘location‘].replace(window[‘location‘][‘href‘])
- self[‘location‘][‘assign‘](window[‘location‘][‘href‘])
- self[‘location‘][‘replace‘](window[‘location‘][‘href‘])
- window.location[‘href‘] = location
- window.location[‘href‘] = location.href
- window.location[‘href‘] = window.location
- window.location[‘href‘] = self.location
- window.location[‘href‘] = window.location.href
- window.location[‘href‘] = self.location.href
- window.location[‘href‘] = location[‘href‘]
- window.location[‘href‘] = window[‘location‘]
- window.location[‘href‘] = window[‘location‘].href
- window.location[‘href‘] = window[‘location‘][‘href‘]
- window.location[‘href‘] = window.location[‘href‘]
- window.location[‘href‘] = self[‘location‘]
- window.location[‘href‘] = self[‘location‘].href
- window.location[‘href‘] = self[‘location‘][‘href‘]
- window.location[‘href‘] = self.location[‘href‘]
- location.assign(window.location[‘href‘])
- location.replace(window.location[‘href‘])
- window.location.assign(window.location[‘href‘])
- window.location.replace(window.location[‘href‘])
- self.location.assign(window.location[‘href‘])
- self.location.replace(window.location[‘href‘])
- location[‘assign‘](window.location[‘href‘])
- location[‘replace‘](window.location[‘href‘])
- window.location[‘assign‘](window.location[‘href‘])
- window.location[‘replace‘](window.location[‘href‘])
- window[‘location‘].assign(window.location[‘href‘])
- window[‘location‘].replace(window.location[‘href‘])
- window[‘location‘][‘assign‘](window.location[‘href‘])
- window[‘location‘][‘replace‘](window.location[‘href‘])
- self.location[‘assign‘](window.location[‘href‘])
- self.location[‘replace‘](window.location[‘href‘])
- self[‘location‘].assign(window.location[‘href‘])
- self[‘location‘].replace(window.location[‘href‘])
- self[‘location‘][‘assign‘](window.location[‘href‘])
- self[‘location‘][‘replace‘](window.location[‘href‘])
- self[‘location‘] = location
- self[‘location‘] = location.href
- self[‘location‘] = window.location
- self[‘location‘] = self.location
- self[‘location‘] = window.location.href
- self[‘location‘] = self.location.href
- self[‘location‘] = location[‘href‘]
- self[‘location‘] = window[‘location‘]
- self[‘location‘] = window[‘location‘].href
- self[‘location‘] = window[‘location‘][‘href‘]
- self[‘location‘] = window.location[‘href‘]
- self[‘location‘] = self[‘location‘]
- self[‘location‘] = self[‘location‘].href
- self[‘location‘] = self[‘location‘][‘href‘]
- self[‘location‘] = self.location[‘href‘]
- location.assign(self[‘location‘])
- location.replace(self[‘location‘])
- window.location.assign(self[‘location‘])
- window.location.replace(self[‘location‘])
- self.location.assign(self[‘location‘])
- self.location.replace(self[‘location‘])
- location[‘assign‘](self[‘location‘])
- location[‘replace‘](self[‘location‘])
- window.location[‘assign‘](self[‘location‘])
- window.location[‘replace‘](self[‘location‘])
- window[‘location‘].assign(self[‘location‘])
- window[‘location‘].replace(self[‘location‘])
- window[‘location‘][‘assign‘](self[‘location‘])
- window[‘location‘][‘replace‘](self[‘location‘])
- self.location[‘assign‘](self[‘location‘])
- self.location[‘replace‘](self[‘location‘])
- self[‘location‘].assign(self[‘location‘])
- self[‘location‘].replace(self[‘location‘])
- self[‘location‘][‘assign‘](self[‘location‘])
- self[‘location‘][‘replace‘](self[‘location‘])
- self[‘location‘].href = location
- self[‘location‘].href = location.href
- self[‘location‘].href = window.location
- self[‘location‘].href = self.location
- self[‘location‘].href = window.location.href
- self[‘location‘].href = self.location.href
- self[‘location‘].href = location[‘href‘]
- self[‘location‘].href = window[‘location‘]
- self[‘location‘].href = window[‘location‘].href
- self[‘location‘].href = window[‘location‘][‘href‘]
- self[‘location‘].href = window.location[‘href‘]
- self[‘location‘].href = self[‘location‘]
- self[‘location‘].href = self[‘location‘].href
- self[‘location‘].href = self[‘location‘][‘href‘]
- self[‘location‘].href = self.location[‘href‘]
- location.assign(self[‘location‘].href)
- location.replace(self[‘location‘].href)
- window.location.assign(self[‘location‘].href)
- window.location.replace(self[‘location‘].href)
- self.location.assign(self[‘location‘].href)
- self.location.replace(self[‘location‘].href)
- location[‘assign‘](self[‘location‘].href)
- location[‘replace‘](self[‘location‘].href)
- window.location[‘assign‘](self[‘location‘].href)
- window.location[‘replace‘](self[‘location‘].href)
- window[‘location‘].assign(self[‘location‘].href)
- window[‘location‘].replace(self[‘location‘].href)
- window[‘location‘][‘assign‘](self[‘location‘].href)
- window[‘location‘][‘replace‘](self[‘location‘].href)
- self.location[‘assign‘](self[‘location‘].href)
- self.location[‘replace‘](self[‘location‘].href)
- self[‘location‘].assign(self[‘location‘].href)
- self[‘location‘].replace(self[‘location‘].href)
- self[‘location‘][‘assign‘](self[‘location‘].href)
- self[‘location‘][‘replace‘](self[‘location‘].href)
- self[‘location‘][‘href‘] = location
- self[‘location‘][‘href‘] = location.href
- self[‘location‘][‘href‘] = window.location
- self[‘location‘][‘href‘] = self.location
- self[‘location‘][‘href‘] = window.location.href
- self[‘location‘][‘href‘] = self.location.href
- self[‘location‘][‘href‘] = location[‘href‘]
- self[‘location‘][‘href‘] = window[‘location‘]
- self[‘location‘][‘href‘] = window[‘location‘].href
- self[‘location‘][‘href‘] = window[‘location‘][‘href‘]
- self[‘location‘][‘href‘] = window.location[‘href‘]
- self[‘location‘][‘href‘] = self[‘location‘]
- self[‘location‘][‘href‘] = self[‘location‘].href
- self[‘location‘][‘href‘] = self[‘location‘][‘href‘]
- self[‘location‘][‘href‘] = self.location[‘href‘]
- location.assign(self[‘location‘][‘href‘])
- location.replace(self[‘location‘][‘href‘])
- window.location.assign(self[‘location‘][‘href‘])
- window.location.replace(self[‘location‘][‘href‘])
- self.location.assign(self[‘location‘][‘href‘])
- self.location.replace(self[‘location‘][‘href‘])
- location[‘assign‘](self[‘location‘][‘href‘])
- location[‘replace‘](self[‘location‘][‘href‘])
- window.location[‘assign‘](self[‘location‘][‘href‘])
- window.location[‘replace‘](self[‘location‘][‘href‘])
- window[‘location‘].assign(self[‘location‘][‘href‘])
- window[‘location‘].replace(self[‘location‘][‘href‘])
- window[‘location‘][‘assign‘](self[‘location‘][‘href‘])
- window[‘location‘][‘replace‘](self[‘location‘][‘href‘])
- self.location[‘assign‘](self[‘location‘][‘href‘])
- self.location[‘replace‘](self[‘location‘][‘href‘])
- self[‘location‘].assign(self[‘location‘][‘href‘])
- self[‘location‘].replace(self[‘location‘][‘href‘])
- self[‘location‘][‘assign‘](self[‘location‘][‘href‘])
- self[‘location‘][‘replace‘](self[‘location‘][‘href‘])
- self.location[‘href‘] = location
- self.location[‘href‘] = location.href
- self.location[‘href‘] = window.location
- self.location[‘href‘] = self.location
- self.location[‘href‘] = window.location.href
- self.location[‘href‘] = self.location.href
- self.location[‘href‘] = location[‘href‘]
- self.location[‘href‘] = window[‘location‘]
- self.location[‘href‘] = window[‘location‘].href
- self.location[‘href‘] = window[‘location‘][‘href‘]
- self.location[‘href‘] = window.location[‘href‘]
- self.location[‘href‘] = self[‘location‘]
- self.location[‘href‘] = self[‘location‘].href
- self.location[‘href‘] = self[‘location‘][‘href‘]
- self.location[‘href‘] = self.location[‘href‘]
- location.assign(self.location[‘href‘])
- location.replace(self.location[‘href‘])
- window.location.assign(self.location[‘href‘])
- window.location.replace(self.location[‘href‘])
- self.location.assign(self.location[‘href‘])
- self.location.replace(self.location[‘href‘])
- location[‘assign‘](self.location[‘href‘])
- location[‘replace‘](self.location[‘href‘])
- window.location[‘assign‘](self.location[‘href‘])
- window.location[‘replace‘](self.location[‘href‘])
- window[‘location‘].assign(self.location[‘href‘])
- window[‘location‘].replace(self.location[‘href‘])
- window[‘location‘][‘assign‘](self.location[‘href‘])
- window[‘location‘][‘replace‘](self.location[‘href‘])
- self.location[‘assign‘](self.location[‘href‘])
- self.location[‘replace‘](self.location[‘href‘])
- self[‘location‘].assign(self.location[‘href‘])
- self[‘location‘].replace(self.location[‘href‘])
- self[‘location‘][‘assign‘](self.location[‘href‘])
- self[‘location‘][‘replace‘](self.location[‘href‘])
- location.reload()
- location[‘reload‘]()
- window.location.reload()
- window[‘location‘].reload()
- window.location[‘reload‘]()
- window[‘location‘][‘reload‘]()
- self.location.reload()
- self[‘location‘].reload()
- self.location[‘reload‘]()
- self[‘location‘][‘reload‘]()
以上是关于jquery 打开页面window.location和window.open的区别的主要内容,如果未能解决你的问题,请参考以下文章