944,048 Members | Top Members by Rank

Ad:
Aug 26th, 2005
0

Load new page on site exit

Expand Post »
Is it possible to have a small page load (saying thanks for visiting etc.) when the user closes my website?

Thanks

Martin
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
martinkorner is offline Offline
102 posts
since Aug 2005
Aug 26th, 2005
0

Re: Load new page on site exit

Pop-ups are generally hated by everyone, even if it is just to say thank you.

Just a warning.
Reputation Points: 31
Solved Threads: 1
Junior Poster in Training
leelee is offline Offline
76 posts
since Aug 2005
Aug 29th, 2005
0

Re: Load new page on site exit

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cppforlife is offline Offline
20 posts
since Aug 2005
Aug 30th, 2005
0

Re: Load new page on site exit

I tried it but it didn't work.
Thanks anyway.
Martin
Reputation Points: 10
Solved Threads: 0
Junior Poster
martinkorner is offline Offline
102 posts
since Aug 2005
Aug 30th, 2005
0

Re: Load new page on site exit

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cppforlife is offline Offline
20 posts
since Aug 2005
Aug 31st, 2005
0

Re: Load new page on site exit

Thanks a lot
It works!!!

Thanks again
Martin
Reputation Points: 10
Solved Threads: 0
Junior Poster
martinkorner is offline Offline
102 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Dead End Pages
Next Thread in HTML and CSS Forum Timeline: The new "haslayout" IE CSS feature - Explained





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC