Multiple New Windows (popups) with Javascript

1 replies

I have used javascript to open up new windows many times before using something like this:

onclick="'more-info-1.html','My Popup','width=300,height=150')

I have a page with numerous links, each of which opens up a new window using the script above. However, instead of opening A NEW windows the code above loads the new page into the window which was already popped up.

What I am noticing is that I would press on the first link and a new popup would then appear, which is great. Without closing the popup, I would then press on the second link. At this point, the new page is loaded into the popup window which is already open (from link 1). However, the focus remains on the main window rather than on the popup window, which makes it look like the link is inactive.

Sorry if I am not clear enough. Really tired at the moment but I need to get this issue resolved. I basically want a new popup for each mouse-click.

I tried using the focus() function but I believe it isn't supported by chrome and so I scrapped it since it wasn't supported by all browsers.

Any help would be much appreciated.
#javascript #multiple #popups #windows

Trending Topics