简体   繁体   中英

How to Open many NEW windows in Javascript?

Wondering how to open many new windows with Javascript. I have found plenty of places on the internet that show you how to open a new browser window with Javascript, but I want to open a new UNIQUE window. For Example.

I have two links on a page. the user clicks on both links and they are both opened in the same window. I want each link to open a new window WITH JAVASCRIPT.

Another Example. I just opened a window with javascript and I have a link inside my newly opened window. I click on the link and it opens in the same window. I want to pop it out of that window WITH JAVASCRIPT, NOT use the same window.

Help?

window.open('page.html','WindowTitle','width=400,height=200')

Like the previous poster said, you want window.open(...)

var WindowObjectReference = window.open(strUrl, strWindowName [, strWindowFeatures]); 

https://developer.mozilla.org/En/DOM/Window.open

Make sure that you have different strWindowName for each call since that determines which window the URL is opened in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM