another basic question about cgi exit pop up's that rotate

  • maxxer
  • Born
  • Born
  • No Avatar
  • Joined: Nov 07, 2003
  • Posts: 1
  • Loc: none
  • Status: Offline

Post November 7th, 2003, 2:18 pm

I am looking to eliminate some java script pop ups, but I would like to shift them to on exit.

I use the javascript rotator to display different URL's, I can rotate as many as I wish, but I want to change it so it is on exit, or find and exit.cgi application.

here is a copy of the code

<Script Language="JavaScript">
<!--
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.example.com1";
}
if (ad==2) {
url="http://www.example2.com";
}
if (ad==3) {
url="http://www.example3.com";
}
rotpop=window.open('','rotpop','toolbar=1,menubar=1,scrollbars=1,status=1,resizable=1,top=1,left=1,width=640,height=480');
rotpop.blur();
rotpop.location=url;
-->
</script>
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 7th, 2003, 2:18 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post November 7th, 2003, 3:39 pm

I don't have the answer to your problem, personally, but I just wanted to add my 2 cents. If I was leaving your site and got an onExit pop-up, you just decreased your chances that I would ever visit your site again by at least half. And if you combined that with pop-ups when I arrived, you'd better have something compelling for me to ever want to come back. IMHO pop-up ads are the most annoying things on earth. Over the last couple years they surpassed the most annoying thing on earth -- the common housefly. And I rank the housefly about 50% higher on the ladder.

I wish you good luck, though. I'm sure someone here will be able to tell you how. That's the beauty of this place. We can all enjoy the things we like or dislike together, because we are designer's and everyone is unique.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • RichB
  • Guru
  • Guru
  • User avatar
  • Joined: May 17, 2003
  • Posts: 1121
  • Loc: Boston
  • Status: Offline

Post November 11th, 2003, 6:18 am

You could try this. The only drawback (besides obvious dislike/blocking of popups) is that the script will run if the page is refreshed. I don't know any way around that problem.

Code: [ Select ]
<Script Language="JavaScript">
<!--
window.onunload = doPopup;

function doPopup(){
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.example.com1";
}
if (ad==2) {
url="http://www.example2.com";
}
if (ad==3) {
url="http://www.example3.com";
}
rotpop=window.open('','rotpop','toolbar=1,menubar=1,scrollbars=1,status
=1,resizable=1,top=1,left=1,width=640,height=480');
rotpop.blur();
rotpop.location=url;
}
--> 
</script>
  1. <Script Language="JavaScript">
  2. <!--
  3. window.onunload = doPopup;
  4. function doPopup(){
  5. var how_many_ads = 3;
  6. var now = new Date()
  7. var sec = now.getSeconds()
  8. var ad = sec % how_many_ads;
  9. ad +=1;
  10. if (ad==1) {
  11. url="http://www.example.com1";
  12. }
  13. if (ad==2) {
  14. url="http://www.example2.com";
  15. }
  16. if (ad==3) {
  17. url="http://www.example3.com";
  18. }
  19. rotpop=window.open('','rotpop','toolbar=1,menubar=1,scrollbars=1,status
  20. =1,resizable=1,top=1,left=1,width=640,height=480');
  21. rotpop.blur();
  22. rotpop.location=url;
  23. }
  24. --> 
  25. </script>
Free Programming Resources
  • sakib000
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Mar 09, 2007
  • Posts: 6
  • Status: Offline

Post April 7th, 2007, 9:50 am

how can i rotate ads on my site http://www.photosharingworld.com

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: Kurthead+1 and 135 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.