Load new page on site exit

Reply

Join Date: Aug 2005
Posts: 102
Reputation: martinkorner is an unknown quantity at this point 
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Load new page on site exit

 
0
  #1
Aug 26th, 2005
Is it possible to have a small page load (saying thanks for visiting etc.) when the user closes my website?

Thanks

Martin
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 76
Reputation: leelee is an unknown quantity at this point 
Solved Threads: 1
leelee leelee is offline Offline
Junior Poster in Training

Re: Load new page on site exit

 
0
  #2
Aug 26th, 2005
Pop-ups are generally hated by everyone, even if it is just to say thank you.

Just a warning.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 20
Reputation: cppforlife is an unknown quantity at this point 
Solved Threads: 0
cppforlife cppforlife is offline Offline
Newbie Poster

Re: Load new page on site exit

 
0
  #3
Aug 29th, 2005
Try create function in javascript like below:

HTML and CSS Syntax (Toggle Plain Text)
  1. <script language=javascript>
  2. function thankYou(){
  3. var win=window.open('your popup url', 'thank you', 'window_options');
  4. }
  5. </script>

and insert in the body tag:

HTML and CSS Syntax (Toggle Plain Text)
  1. <body onunload="thankYou()">

not sure. try it.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 102
Reputation: martinkorner is an unknown quantity at this point 
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Re: Load new page on site exit

 
0
  #4
Aug 30th, 2005
I tried it but it didn't work.
Thanks anyway.
Martin
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 20
Reputation: cppforlife is an unknown quantity at this point 
Solved Threads: 0
cppforlife cppforlife is offline Offline
Newbie Poster

Re: Load new page on site exit

 
0
  #5
Aug 30th, 2005
Sorry i mistyped 'onUnload'
(working example @ http://www.geocities.com/cppforlife/.../thankyou.html)

HTML and CSS Syntax (Toggle Plain Text)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <title>Thank You!!!</title>
  6. <script language=javascript>
  7. function thankYou(){
  8. var win=window.open("panel.html", "win");
  9. }
  10. </script>
  11. </head>
  12.  
  13. <body onUnload="thankYou()">
  14. <a href="http://www.yahoo.com">Y!</a>
  15.  
  16.  
  17. </body>
  18. </html>

code above checked in IE and worked properly..
Also replace 'panel.html' with url of you thenk you page.

If you want to change size of the window and other attributes add third argument to open function like below


HTML and CSS Syntax (Toggle Plain Text)
  1. var win=window.open("panel.html", "win", "left=20,top=20,width=500,height=500");

Good luck.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 102
Reputation: martinkorner is an unknown quantity at this point 
Solved Threads: 0
martinkorner's Avatar
martinkorner martinkorner is offline Offline
Junior Poster

Re: Load new page on site exit

 
0
  #6
Aug 31st, 2005
Thanks a lot
It works!!!

Thanks again
Martin
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC