Change the window name in your two different calls:

function popitup(url,windowName) {
       newwindow=window.open(url,windowName,'height=200,width=150');
       if (window.focus) {newwindow.focus()}
       return false;
     }

windowName must be unique when you open a new window with same url otherwise the same window will be refreshed.

Answer from Umesh on Stack Overflow
๐ŸŒ
JavaScript.info
javascript.info โ€บ tutorial โ€บ frames and windows
Popups and window methods
The open call returns a reference to the new window. It can be used to manipulate its properties, change location and even more. In this example, we generate popup content from JavaScript:
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ API โ€บ Window โ€บ open
Window: open() method - Web APIs | MDN
By default, window.open opens the page in a new tab. If popup is set to true, it requests that a minimal popup window be used. The UI features included in the popup window will be automatically decided by the browser, generally including an address bar only.
Discussions

Open Pop Up from another Pop Up | OutSystems
I'm trying to open a Popup from another Popup using the Popup_Editor widget only, and without the second Popup window being "inside" and limited in size by the first Popup. The solution i have now is opening the second Popup using Javascript function window.open(). I really wanted to use only ... More on outsystems.com
๐ŸŒ outsystems.com
Best practices for opening new window (pop up or pop under) with JavaScript
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? Yeah. Don't. More on reddit.com
๐ŸŒ r/javascript
10
0
April 12, 2011
Opening popup windows in HTML - Stack Overflow
I am working with web apps, and I am wondering if there is a way to open a link in an app-type window using HTML? Something like this: My App More on stackoverflow.com
๐ŸŒ stackoverflow.com
popupwindow - How to open popup in JavaScript? (NOT window.open) (it is window.open) - Stack Overflow
This is kind of a dumb question, but what is the command to open a popup window in JS? I know that window.open works, but on chrome, it shows the tabs, which I have seen in popups not existing. It More on stackoverflow.com
๐ŸŒ stackoverflow.com
January 25, 2023
๐ŸŒ
Quackit
quackit.com โ€บ javascript โ€บ popup_windows.cfm
JavaScript Popup Windows
If you only want to open a new browser window you can add the target="_blank" attribute within the <a> element (see this article on opening a new window in HTML). JavaScript popup windows however, are more powerful. Using JavaScript's window.open() method, you can determine what the window ...
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ met_win_open.asp
Window open() Method
More examples below. The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values.
๐ŸŒ
Javascript-coder
javascript-coder.com โ€บ window-popup โ€บ javascript-window-open
Using the window.open method | JavaScript Coder
<html> <head> <title>JavaScript Popup Example 3</title> </head> <script type="text/javascript"> function exitpop() { my_window = window.open("", "mywindow1", "status=1,width=350,height=150"); my_window.document.write('<h1>Popup Test!</h1>'); } </script> <body onunload="javascript: exitpop()" > <h1>JavaScript Popup Example 4</h1> </body> </html>
Find elsewhere
๐ŸŒ
HTML.com
html.com โ€บ javascript โ€บ popup-windows
Popup Windows Made Easy: Here's The JavaScript Code To Copy And Paste ยป
March 19, 2020 - The entire list of properties goes inside quotes. So, for example, the following line of code sets width to 400, height to 200, and turns scrollbars on. window.open(' ', windowname, 'height=200,width=400,scrollbars=yes');
๐ŸŒ
SitePoint
sitepoint.com โ€บ blog โ€บ javascript โ€บ js code snippet to open a popup window
js code snippet to open a popup window โ€” SitePoint
February 13, 2024 - Here is a basic example: var myWindow = window.open("", "myWindow", "width=200,height=100"); myWindow.document.write("<p>This is 'myWindow'</p>"); In this example, the window.open() method takes three parameters: the URL of the page to open (left blank here to create an empty window), the name ...
๐ŸŒ
Laurentian
web.cs.laurentian.ca โ€บ rsgrewal โ€บ c2206 โ€บ javascript โ€บ examples โ€บ windows โ€บ windows.html
Opening a pop up window
Close pop up window and click the following link to open it again. ... This method uses a special form of link which just executes a javascript function. ... Other useful features are menubar="yes", resizable="yes", scrollbars="yes", toolbar="yes", and status="yes". Note that the javascript designers cannot spell: use resizable not resizeable. The default values are "no". Click the following link to see a popup window with these values turned on.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-create-a-new-popup-window-in-JavaScript
How to create a new popup window in JavaScript - Quora
Answer (1 of 2): I would suggest you to use window.open() Here is the syntax and parmeter of window.open(): window.open(URL, windowName, [windowFeatures]) URL: The URL of the page to open.
๐ŸŒ
Your HTML Source
yourhtmlsource.com โ€บ html source โ€บ javascript โ€บ popup windows | open new customised windows with javascript
Popup Windows | open new customised windows with JavaScript
November 17, 2025 - So, a fully kitted-out new window might look more like this: newwindow=window.open(url,'name','height=500,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
๐ŸŒ
Inductive Automation
docs.inductiveautomation.com โ€บ visualization and dashboards โ€บ windows โ€บ popup windows โ€บ open popup window
Open Popup Window | Ignition User Manual
December 11, 2023 - You can use a button, a label, an image or any component you like to open up a popup window. This example opens a popup window from a Main Window using a Button component. In any Main Window, drag a Button component from the Component Palette to your window.
๐ŸŒ
OutSystems
outsystems.com โ€บ forums โ€บ discussion โ€บ 20540 โ€บ open-pop-up-from-another-pop-up
Open Pop Up from another Pop Up | OutSystems
I'm trying to open a Popup from another Popup using the Popup_Editor widget only, and without the second Popup window being "inside" and limited in size by the first Popup. The solution i have now is opening the second Popup using Javascript function window.open(). I really wanted to use only ...
๐ŸŒ
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?

๐ŸŒ
Super Dev Resources
superdevresources.com โ€บ home โ€บ blog โ€บ development โ€บ how to open links in a popup window
How to Open Links in a Popup Window - Super Dev Resources
June 18, 2020 - You can specify the left and right attributes to position the popup window. Reply ยท Sir, i want mouse over pop up. thanks in advance. Reply ยท hi , can you plz tell me how to link a html page as pop up on clicking button with overlay effect? Reply ยท Hi Rashmi. You can take a look at popup dialog libraries such as https://sweetalert.js.org/ Reply ... Thank you so much. It worked. Reply ... Great post, thanks a lot for providing this example with usable HTML-code. Reply ... Hi, I am trying to open the popup through a button and not through the words Open Link in Popup.
๐ŸŒ
Poper
poper.ai โ€บ guides โ€บ popup-window-open
How to Make a Popup Window Open (Code & No-Code Methods) - Poper
August 22, 2025 - Learn how to make a popup window open on your website. This guide covers JavaScript window.open(), modern modal popups with code, and easy tools like Poper.