Use window.open():

<a onclick="window.open(document.URL, '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');">
  Share Page
</a>

This will create a link titled Share Page which opens the current url in a new window with a height of 570 and width of 520.

Answer from citruspi on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name.
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
window.open("http://www.google.com/"); window.open("https://www.w3schools.com/"); Try it Yourself » · Open a new window.
🌐
JavaScript.info
javascript.info › tutorial › frames and windows
Popups and window methods
The syntax to open a popup is: window.open(url, name, params): ... An URL to load into the new window.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-a-new-window-using-javascript
How to open URL in a new window using JavaScript? - GeeksforGeeks
August 21, 2025 - The window.open() method is used to open a new browser window or a new tab, depending on the browser settings and the parameter values provided.
🌐
Electron
electronjs.org › opening windows from the renderer
Opening windows from the renderer | Electron
There are several ways to control how windows are created from trusted or untrusted content within a renderer. Windows can be created from the renderer in two ways: clicking on links or submitting forms adorned with target=_blank ... For same-origin content, the new window is created within the same process, enabling the parent to access the child window directly.
🌐
Reintech
reintech.io › blog › tutorial-working-with-the-window-open-method
Working with the window.open() Method | Reintech media
February 22, 2023 - The window.open() method accepts three parameters and returns a reference to the newly created window object:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Mozilla › Add-ons › WebExtensions › API › windows › create
windows.create() - Mozilla | MDN
If not specified, the new window is offset naturally from the last focused window. (Ignored in Firefox 108 or earlier for panel or popup window types; positioning the window using windows.update() could be used as a workaround.) ... A windows.CreateType value. Specifies what type of browser window to create. Specify panel or popup here to open a window without any of the normal browser UI (address bar, toolbar, etc.).
Find elsewhere
🌐
Atlassian Community
community.atlassian.com › q&a › jira › questions › open new browser window using "window.open" method is not working in the forgeapp
Open new browser window using "window.open" method is not working in the ForgeApp
June 27, 2022 - window.open("https://www.google.com", '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes') ... ApprovalGroups.jsx:144 Blocked opening 'https://www.google.com' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set."
🌐
Google Support
support.google.com › chrome › thread › 126402572 › how-do-i-open-a-second-window-not-a-tab-of-chrome-that-opens-my-homepage
How do I open a second window (not a tab) of chrome that opens my homepage? - Google Chrome Community
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on
🌐
University of New Mexico
unm.edu › ~tbeach › IT145 › week13 › example10.html
Javascript Opening Windows
Let's not specify the extra settings and let it open in a new window with this link.
🌐
YouTube
youtube.com › tech time with timmy
How To Open A New Window In Chrome - YouTube
In this video, Timmy shows you the three different ways to open a new window in Google Chrome. So that you can have multiple Chrome windows open at once.Alte...
Published   March 12, 2024
Views   6K
🌐
OutSystems
outsystems.com › forums › discussion › 65977 › open-link-in-a-new-window-not-tab
Open link in a new window (NOT TAB) | OutSystems
I have a link on my page, and I want it to open it in a new window (not a new tab) when clicking it. Currently, this link points to a new screen action, and in this new screen action I have a RunJavaScript server action with the following script: · However, it still open the link in new tab ...
🌐
Coderanch
coderanch.com › t › 118092 › languages › options-opening-window
options for opening a new window (HTML Pages with CSS and JavaScript forum at Coderanch)
One large drawback to using a window.open() is the IE information bar that appears when a supposed pop-up is encountered. An alternative to window.open is to use the target tag on a link or form. But that doesn't give you as much control.
🌐
TutorialsPoint
tutorialspoint.com › how-to-open-link-in-a-new-window-javascript
How to open link in a new window using JavaScript?
JavaScript window.open() method allows you to open a new browser window or tab, with the specified URL.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-window-open-method
JavaScript window.open() Method - GeeksforGeeks
August 5, 2025 - The Javascript window.open() method is used to open a new tab or window with the specified URL and name.
🌐
Reddit
reddit.com › r/javascript › best practices for opening new window (pop up or pop under) with javascript
r/javascript on Reddit: Best practices for opening new window (pop up or pop under) with JavaScript
April 12, 2011 -

Here at work, we do a fair bit of surveys on various sites via Survey Monkey. The MO has always been to do a pop under window - focus the parent, not the child/new window. I've stressed how I think this is slimey (hiding the new window), but it is what it is and that's that :)

Seems every time we have a survey, I'll get people coming to me because the new window is getting blocked by someone. I've looked at the code they're using and it's using the typical window.onload event. I tell them this is probably why they're getting blocked as the pop up blockers are no doubt seeing automatically opened windows as unwanted advertising. Because the window onload and onunload events have been so abused, this is why we have pop up blockers built into browsers as well as plugins.

I thought about perhaps using a timer to delay execution of the pop up from onload, but not sure if this will make any difference. I'm kind of guessing not but I haven't tested it yet. I can't really test it as it's another dept. that has access to the server, not me... I've also thought about using onmousemove to trigger it (user-triggered event) and then nulling that out but that seems even more stupid.

I've suggested adding static survey promos which would be user-triggered events as I think those might fare better in the world of pop up blockers - even though there's still no guarantee. So the user clicks to pop the new window.

I've also suggested removing JS from the equation altogether and having the promos link straight to Survey Monkey. The counter there is that they've lost where they are in our site (they could have deep-linked in). They can't just easily close the Survey Monkey window to pick back up where they left off in their task. Off the top of my head, I don't know if they can use their back button to backtrack from the end of the Survey Monkey survey, either.

Is there a general consensus of best practices in regards to opening a new pop up (or pop under) window with JavaScript with pop up blockers?

🌐
W3Schools
w3schools.com › js › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
Wikihow
wikihow.com › computers and electronics › internet › internet browsers › how to open a new window: 4 easy ways
How to Open a New Window: 4 Easy Ways
June 4, 2025 - You can also click “File” and select “New Window.” ... Right click on the link on your current window. ... Choose Open in New Window. The page will open in a new window.