Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > Other Programming - Perl, C++, Java, ASP, .NET Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-19-2006, 04:35 AM   #1 (permalink)
Mindi
Junior Member
 
Join Date: Sep 2006
Posts: 7
Default How to keep this javascript going instead of restarting on page onload?

Hi, I have some javascript that rotates items. Problem is
as soon as you leave my web page and come back it starts over. Any way to keep it going all on its own so everything gets rotated?
Here's the code with the problem under the [2] content. Its set to change every hour, but starts over as soon as you revisit the page. Please let me know how to fix this so it doesn't start over when you visit the page but keeps going. That way if someone comes back to it is rotating something new. Thank you very much! Mindi

content[0] = ".txt";
content[1] = ".txt";
content[2] = ".txt";

var counter = 0;
function secondsplus_iframe()
{ document.getElementById("dynstuff").src = content[counter];
counter++; if (counter == content.length)
counter = 0; } setInterval("secondsplus_iframe()", 3600000);
Mindi is offline   Reply With Quote
Sponsored Links
Old 10-23-2006, 04:07 AM   #2 (permalink)
BurgerKing
Junior Member
 
Join Date: Oct 2006
Posts: 5
Default Re: How to keep this javascript going instead of restarting on page onload?

You will need to drop a cookie on the user's computer when you change ads, and then read it when the user visits the page again.

That way, you can start where you left off, rather than at the beginning.
BurgerKing is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:24 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums