• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reloading Calling Page

 
Steve Dyke
Ranch Hand
Posts: 1643
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a link on my HTML page that opens a another page. When the called page is closed I need it to run the following code. I have a link on the called page that will do this however I cannot guarantee the user will click the link. How can I make sure this code will run if user just closes the window?

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't tell the difference between the user closing the window and navigating away.

What are you really trying to accomplish? Whatever it is, this isn't the way to do it.

 
Steve Dyke
Ranch Hand
Posts: 1643
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
What are you really trying to accomplish? Whatever it is, this isn't the way to do it.



Page 1 has record header data and a table showing child records. There is a link that is used to open another window(window 2) to add more child records. When window 2 closes I want to make a call to the servlet that feeds the window 1 page. Lastly I want the window 1 to reload so the new child records show up.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, that's a bit clearer. If you don't care about the difference between closing and navigating away, the beforeunload event might be of help.
 
Steve Dyke
Ranch Hand
Posts: 1643
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,

I decided to create a input row on the main form itself to add new child records. I hope this is a correct choice.

Thanks for the help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic