aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes closing the child window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "closing the child window" Watch "closing the child window" New topic
Author

closing the child window

arpit singla
Ranch Hand

Joined: Jun 18, 2001
Posts: 66
Link in my main jsp opens a child jsp. User fills in the data in this child jsp and clicks submit. Data is submitted to the servlet. After the data is submitted, i want to close this child jsp automatically and focus back on the main jsp. Could sb. suggest me the way to do it.
the way i am opening the child jsp is:
<a href="javascript:window.open('http://localhost:8080/child.jsp','newwindow','toolbar=no,width=600,height=200'); void('');">Open Child Window</a>
thanks
arpit
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Originally posted by arpit singla:
Link in my main jsp opens a child jsp. User fills in the data in this child jsp and clicks submit. Data is submitted to the servlet. After the data is submitted, i want to close this child jsp automatically and focus back on the main jsp. Could sb. suggest me the way to do it.
the way i am opening the child jsp is:
<a href="javascript:window.open('http://localhost:8080/child.jsp','newwindow','toolbar=no,width=600,height=200'); void('');">Open Child Window</a>
thanks
arpit

I assume that you want your main window to close the child window. Open ur child window with a function -

Your link will be -

(remove underscore)
Now when you want to close the child window thru main window simply call -
childWin.close(); Just make sure thatyour vaiable childWin has global scope and is not only local to function openWin().
If you want your child window to close itself, you can simply call self.close() to close it.
HTH,
- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: closing the child window
 
Similar Threads
How to persist data of child window form
How to make two submits to work serially
No javascript for child windows.
calling a jsp without using a controller
No javascript for child windows.