开发者

window.open(URL,name,specs,replace) ?? name Vs replace

开发者 https://www.devze.com 2023-04-09 06:02 出处:网络
If current win开发者_开发百科dow iswww.myparent.com by clicking a button-a, it invokes this function window.open(\'children\',\'same\',\'\',??). The new page opens as www.myparent.com/children

If current win开发者_开发百科dow iswww.myparent.com by clicking a button-a, it invokes this function window.open('children','same','',??). The new page opens as www.myparent.com/children

Clicking button-b, it invokes this function window.open('sub','same','',??).

www.myparent.com/children is replaced by www.myparent.com/sub

Now I want to know, what is the use of replace (true/false). Please take a look the syntax definition


Actually 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)

0

精彩评论

暂无评论...
验证码 换一张
取 消