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