This is my first post in a series called 4Nubs. Which is basically programming tutorials for noobs. So, here I go… Tell me what you think.
If you use GMail, or if you’ve ever been to GMail.com, you’ll know that they have this cool ad for their huge storage space. It’s a number that goes up continuously. Google wants you to think that you’re gaining storage space continuously.
Say, I wanted to make a hit-counter that would update itself automatically. So, I figure out that I get 1 visitor every 23 seconds. (It’s actually a lot less )
So, here’s what I would do:
First, lets layout my new magic hit counter.
You are visitor number <span id="hitcounter"></span>.
var delay=23000; //Time in milliseconds
var startvalue=400; //What number to start with
document.getElementById("hitcounter").innerHTML = startvalue;
So, every 23 seconds, the hit counter will go up by one. But to get the number of hits that have already passed, you’ll need some more programming.. Hmm. So I guess this isn’t really useful.