• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open a separate new window

 
Saurabh Saha
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to open a new popup window that not depend on it's parent window. I'm using window.open inside javascript that display some message. when user click on the ok button of this window only then remaining code of my parent window are executing. I want to open a separate window to dispay a message so that if user not click on the ok button my code on the parent window still execute.
please help me!

Thanks,
Saurabh
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to HTML/Javascript.
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what you need is a modal dialog box.

try
window.showModalDialog(url,....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that modal boxes are IE-specific.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Be aware that modal boxes are IE-specific.


Bear, I think you need to re-look at Mozilla. They have implemented it!

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, let me re-phrase: be aware that modal dialogs are non-standard and some browsers support different prorietary means to implement them. showModalDialog, for example, is IE-specific.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lol....
 
Saurabh Saha
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for replies.
I want to open a popup window in which I show some message and there would be a close button to close this window, if user does not close this window I want to close this window after 10 seconds.I had tried an example code with window.open as show below:

windowHandle = window.open('childPage.jsp','mywindow','width=400,height=200');
setTimeout('windowHandle.close()',10000);

It is working fine it open a new window and close this window after 10 seconds, but I can not send any argument by using window.open so I tried showModalDialog() to open a new window, I'm specific for IE so showModalDialog() is working fine in this browser. In my new code I'm using:
showModalDialog('childPage.jsp',ArgumentPassed,'dialogHeight:9;dialogWidth:27;help ff;status:no;fullscreen=no;unadorned=yes');
I want to close this window after 10 seconds.

Thanks,
Saurabh Saha
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
put the window.close() into the modal window code instead of the parent.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic