最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Open popup from another popup - Stack Overflow

programmeradmin4浏览0评论

I am trying to open a popup window from another popup window using window.open method but it is simply opening the second popup in the previous popup window.

Code I am currently using:

win= window.open(Window,"child","top=250,left=310,Width=300,Height=150,Location=no,Scrollbars=no") win.focus(); 

I am trying to open a popup window from another popup window using window.open method but it is simply opening the second popup in the previous popup window.

Code I am currently using:

win= window.open(Window,"child","top=250,left=310,Width=300,Height=150,Location=no,Scrollbars=no") win.focus(); 
Share Improve this question edited Jan 20, 2010 at 14:13 Doug Neiner 66.2k13 gold badges110 silver badges118 bronze badges asked Jan 20, 2010 at 13:58 AnkitAnkit 2813 gold badges4 silver badges8 bronze badges 5
  • @Banang - check out the tags. – Joel Etherton Commented Jan 20, 2010 at 14:01
  • 2 Popup hell is so nineties... :-) – nfechner Commented Jan 20, 2010 at 14:01
  • @nfechner - Poppy like it's 1999? – Joel Etherton Commented Jan 20, 2010 at 14:01
  • I am using : win= window.open(Window,"child","top=250,left=310,Width=300,Height=150,Location=no,Scrollbars=no") win.focus(); – Ankit Commented Jan 20, 2010 at 14:04
  • 1 I smell.... evil. And biscuits (morning here, sorry). – user1228 Commented Jan 20, 2010 at 14:05
Add a ment  | 

2 Answers 2

Reset to default 8

Make sure you're using a new name for your second new window. If you provide the same name you'll experience this behavior.

open(URL, windowName[, windowFeatures]) 

If you do not care what the name of the window is instead of "child" use "_blank" which will always open in a new window. see W3Schools

发布评论

评论列表(0)

  1. 暂无评论