counter html code questions
Results 1 to 8 of 8

Thread: counter html code questions

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Posts
    5

    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?


  2. #2
    the beign of authority kurt_der_koenig's Avatar
    Join Date
    Jan 2004
    Location
    Pa
    Posts
    567
    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.

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    Great! Thanks so much, but as for the first question: is there a counter which just counts upwards every minute or so?

  4. #4
    the beign of authority kurt_der_koenig's Avatar
    Join Date
    Jan 2004
    Location
    Pa
    Posts
    567
    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.

  5. #5
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    Sorry to ask such a stupid question, BUT I have no alternative: what is the javascript code which counts in the counter?

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    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.

  7. #7
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    Really? Zt! 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!)

  8. #8
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    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
  •