How to always open a new page in a new window with JavaScript?

In order to always open a new page in a new window you can employ window.open function of JavaScript:

window.open(URL, UNIQUE_TITLE, WINDOW_FEATURES)

Note: If you have a number of links that use this JavaScript snippet and want to open each of them in a separate window remember to set UNIQUE_TITLE to a unique string for each of them. If those strings are the same, the new window will be created only once and it will be reused every time you click such link.

Enjoy this Post?

Your vote will help me grow this site and provide even more information

3 Responses to “How to always open a new page in a new window with JavaScript?”


Leave a Reply