Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Windows using window.open()

Tags:

So as we all know if you click on a submit button that has embedded in it a onClick(windown.open(...)) this opens a new window with all the lovely attributes you specify. However if then proceed to click on the parent window and again click on the 'submit' button without closing the previous popup window, then that same window is overwritten with the new data.

Now I need a way for that window.open() script to create new windows every time it is clicked. SO in theory I could click the parent "submit" button 2 consecutive times and have 2 different child windows appear.

I'm sure it's trivial but I can't seem to find anything.

like image 291
Percia Nancy Avatar asked Sep 11 '13 04:09

Percia Nancy


People also ask

How do I open multiple windows?

Select the Task View icon on the taskbar, or press Alt-Tab on your keyboard to see apps or switch between them. To use two or more apps at a time, grab the top of an app window and drag it to the side. Then choose another app and it'll automatically snap into place.

Does window open create a new session?

When you open a page in a new tab or window, the web browser creates a new session. If you open multiple tabs or windows with the same URL, the web browser creates a separate sessionStorage for each tab or window.

How do I return a value from a Windows Open?

Typically the onclick event on the "Yes" or "Ok" button in the modal dialog looks like this: window. returnValue = true; window. close();


1 Answers

Give each window a new window name.

window.open(url, WindowName) 
like image 153
epascarello Avatar answered Sep 28 '22 10:09

epascarello