使用window.open多个Windows() [英] Multiple Windows using window.open()

查看:479
本文介绍了使用window.open多个Windows()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,大家都知道,如果你点击一个提交按钮已经嵌入了的onClick(windown.open(...))这将打开指定的所有属性,可爱的一个新窗口。但是,如果然后继续单击德父窗口并再次点击提交按钮wihtout关闭previous弹出窗口,那么同一窗口将会覆盖新的数据。

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 teh parent window and again click on the 'submit' button wihtout closing the previous popup window, then that same window is overwritten with the new data.

现在我需要为window.open()脚本来创建新窗口每次被点击的方式。所以理论上我可以单击父提交按钮2次连续和有2个不同的子窗口出现。

Now I need a way for that "window.open()" script to create new windows everytime 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.

在此先感谢,
南希

thanks in advance, nancy

推荐答案

试试这个,这将创造新的孩子,小提琴

try this,it will create new child, fiddle

var randomnumber = Math.floor((Math.random()*100)+1); 
 window.open(yoururl,"_blank",'PopUp',randomnumber,'scrollbars=1,menubar=0,resizable=1,width=850,height=500');

这篇关于使用window.open多个Windows()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆