tags:

views:

69

answers:

2

Following Javscript can open popup:

window.open('http://www.google.com','mywindow','width=400,height=200');

If call it two times like:

window.open('http://www.google.com','mywindow1','width=400,height=200');
window.open('http://www.google.com','mywindow2','width=400,height=200');

The later will override previous only one popup. I want to two separated windows for popup at sametime with above code. even I set different reference name like mywindow1, mywindow2.

How to fix this problem?

More info:

The way I call js in code-behind is:

string js = "<script language=javascript> window.open("myurl1","_blank","DialogWidth=700;DialogHeight=750;left=30;top=30;");</script>";
Response.Write(sUrl);

js = "<script language=javascript> window.open("myurl2","_blank","DialogWidth=700;DialogHeight=750;left=30;top=30;");</script>";
Response.Write(sUrl);

It looks like later close the previous window.

+1  A: 
window.open('http://www.google.com','_blank','width=400,height=200');
window.open('http://www.google.com','_blank','width=400,height=200');

See MSDN documentation.

David
Correct; you don't need to set a name because `window.open()` returns the window object so you can access it directly.
Aaron Digulla
I tried above solution and still only get one. I use Response.Write(jsstring) in code behind. I added the info in above post.
KentZhou
A: 
T.J. Crowder