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 problem with self.close() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with self.close()" Watch "problem with self.close()" New topic
Author

problem with self.close()

Parashuram Hallur
Ranch Hand

Joined: Sep 18, 2006
Posts: 41
Hello Experts:

My belief is that self.close() should work with any of the browsers. However, I'm facing problem with this function in Mozilla. I know that this can be used to close the pop up windows opened by the script and the pop up Im opening is with the script.

I have written the following script



The backing bean decides which function to execute based on the server side code execution. This works well with the IE and Firefox, but does not work with the Mozilla, I mean the pop up does not close only in Mozilla. The trick I have worked out is on the first load of the page the doNothing() should be called and on submitting the page the method reloadTheParentAndCloseTheChild() should be called. Parent window is getting refreshed, however the pop up does not get close and I see there are no errors listed in the javascript console too. Agian, Im facing this issue only in Mozilla. Does any one know whats the problem here and the solution.

Thanks for your time and help

Regards,
Parash
Parashuram Hallur
Ranch Hand

Joined: Sep 18, 2006
Posts: 41
Hello Friend:

Im desparately looking out for some pointers on this issue. Please let me know if I need to help you more to understand the problem.

I hope some one there responds

Thanks,
Parash
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
Tried using window.close()?
Parashuram Hallur
Ranch Hand

Joined: Sep 18, 2006
Posts: 41
Yes Anirvan, I have tried with the window.close() too. It does not help me.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Well, what I know is that self.close() and window.close() work only in browser windows opened by a script only. You cannot do that to any normal window. It seems that this is what you are trying to do, since you are speaking about a pop-up window. both self.close() and window.close() work well with with all browsers, so this just makes me suspect that something might be wrong with opening the pop-up.

Marcos Drake once had a solution for closing firefox windows and tabs, but that doesn't work now on the newer versions of firefox.


Visit my blog: http://jnassef.blogspot.com/
Parashuram Hallur
Ranch Hand

Joined: Sep 18, 2006
Posts: 41
Thanks Alaa Naseef for the response. I'm using the script to open the pop up.

Here it is

 
wood burning stoves
 
subject: problem with self.close()