• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

closing the child window

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic