|
-
October 31st, 2004, 09:14 PM
#1
Junior Member
counter html code questions
I have two questions concerning codes for counters; first off, is there a html code for minutes a page was up? Secondly, what is the standard people counter html code?
-
October 31st, 2004, 09:23 PM
#2
There is no way to do complex things such as counting in html. Javascript is your the way!
http://www.acejs.com/counterc.html , this page has some scripts that will point you in the right direction.
-
October 31st, 2004, 09:26 PM
#3
Junior Member
Great! Thanks so much, but as for the first question: is there a counter which just counts upwards every minute or so?
-
October 31st, 2004, 09:36 PM
#4
Yes, most definately. Scripts are left up to one's imagination and just takes learning to know how it is done. Searchwww.google.comthere are millions of free scripts online.
-
October 31st, 2004, 10:47 PM
#5
Junior Member
Sorry to ask such a stupid question, BUT I have no alternative: what is the javascript code which counts in the counter?
-
October 31st, 2004, 11:53 PM
#6
Code:
<SCRIPT LANGUAGE="JAVASCRIPT">
alert(Date(document.lastModified));
</SCRIPT>
Add that code to your HTML and it will alert you to the last time the page was updated. I don't remember the code to get the current time, but once you figure that out you could probably overload some operators to get how long since the page was last updated. Checkout http://javascript.internet.com/page-details/
And BTW, a hit-counter won't really work entirely on JavaScript/HTML. Some Serverside scripting is needed to save how many times the page was visited to the website. Most hit-counters already have this worked out behind the scenes so that they can give you a small piece of code to copy/paste into your website that uses their website to count how many hits you get.
-
November 1st, 2004, 02:16 AM
#7
Junior Member
Really? Zût! Because I had a damn good idear to make my counter look mui impressivo; however, I am rather slow with the coding languages, so if no one minds me asking yet another stupid question.... Is it feasible to have the counter be the sum total of how many visitors there have been PLUS the square of the day up, e.g. 5 visitors came on the second of the month so the counter includes: 5(visitors)+4(square of the day), or 9? Is there a code for that? If anyone does it I'll give them however many gmail invites they want(like it means anything anymore!)
-
November 1st, 2004, 05:39 AM
#8
You can manipulate the counter code so that it just makes up a random number each time the page loads. Of course, this is pretty obvious when somebody refreshes your website and it goes from "1000 hits" to "10 hits" or something.
Basically what I'm saying is that given only HTML and Javascript, you can't save the number of times everyone visited a website. But using HTML and Javascript along with a Serverside language, you can save and load the number of hits pretty easily. The server stuff just keeps track of the # of hits, and the HTML/Javascript display it nicely. Luckily for you, many websites provide free hit counters for you where all you need to do is include a small piece of Javascript in your website for it to work.
You can checkout http://www.nextgenstats.com/ and sign your website up for a free counter. Cheers.
PS - I don't need any more gmail invites.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|