admin管理员组文章数量:1336645
If current window iswww.myparent
by clicking a button-a, it invokes this function window.open('children','same','',??)
. The new page opens as www.myparent/children
Clicking button-b, it invokes this function window.open('sub','same','',??)
.
www.myparent/children
is replaced by www.myparent/sub
Now I want to know, what is the use of replace (true/false)
. Please take a look the syntax definition
If current window iswww.myparent.
by clicking a button-a, it invokes this function window.open('children','same','',??)
. The new page opens as www.myparent./children
Clicking button-b, it invokes this function window.open('sub','same','',??)
.
www.myparent./children
is replaced by www.myparent./sub
Now I want to know, what is the use of replace (true/false)
. Please take a look the syntax definition
-
2
In case you didn't know, W3Schools is not affiliated with the W3C and thus do not 'define' the syntax. For functions like
window.open
which were not originally in any specifications, it would be better to read the browser vendor's documentation, such as MSDN for IE and MDN for Firefox – Yi Jiang Commented Sep 30, 2011 at 7:53 -
Xie Xie Jiang ! i went through firefox (MDN) window.open documentation and found that there is nothing like
replace
. – user744587 Commented Sep 30, 2011 at 8:04
1 Answer
Reset to default 4Actually this is the syntax
window.open(URL,name,specs,replace)
and this is the documentation:
As you can see from the docs, replace
Optional.Specifies whether the URL creates a new entry or replaces the current entry in the history list. The following values are supported: - true - URL replaces the current document in the history list - false - URL creates a new entry in the history list
If you set it to true, in your history list the page that is opened in the new window replace the page you are currently browsing (I.E you will not have the page in history)
本文标签:
版权声明:本文标题:javascript - window.open(URL,name,specs,replace) ?? name Vs replace - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742408639a2469338.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论