File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Pop Up Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Pop Up Windows" Watch "Pop Up Windows" New topic
Author

Pop Up Windows

Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Guys!

I have a javascript function that opens a pop- up window. However, I would like to restrict the number of windows being opened. IOW, if I click the link 3 times, the pop up window is opened as 3 different windows. I'd like my function to open the window only once, i.e, if a pop-up window is already opened, the function shouldn't let me open a fresh pop-up.

I hope I did make sense to you?? Or was it all pop-up pop-up??
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Just give a name to the child window you are opening.

This will make sure that only one pop-up window is opened.

But however, in the above approach, the page is loaded everytime when the function is called (but it is loaded to the same window).

Alternativly you can use



This way you avoid loading the page everytime the function is called.


Mani
Quaerendo Invenietis
Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Mani!

Thanks for that, buddy!
 
 
subject: Pop Up Windows
 
Threads others viewed
Problem with pop-up window
How to give the Target of pop-up window form as a frame in the main window
Problem with pop-up window
Session persistence in IE and firefox
Preventing multiple popups
MyEclipse, The Clear Choice