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
For the details, see chapter Cross-window communication. A popup may access the “opener” window as well using window.opener reference.
🌐
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.
🌐
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()" ...
🌐
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');
Find elsewhere
🌐
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 - You can control the size and position ... and positioned 10 pixels from the left and top of the screen, you would use: var myWindow = window.open("", "myWindow", "width=500,height=600,left=10,top=10");...
🌐
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');
🌐
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 - For example.. if you have a website with some blog posts on homepage that launch in a modal window when you click on it, is it possible to open exactly the same way the blog post when you access to it via the url (www.mydomain.com/post_1) ? ... Hi Wesly, While I don’t understand why you would want to do that, you may try to add the following script to the current page for opening it in a popup ...
🌐
Inductive Automation
docs.inductiveautomation.com › visualization and dashboards › windows › popup windows › open popup window
Open Popup Window | Ignition User Manual
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.