Javascript hit counter for a website

前端 未结 4 520
执念已碎
执念已碎 2021-01-18 09:14

I\'m trying to code a hit counter for a website. As a preference, not required, I\'m trying to use Javascript to do this. On the website\'s html file, I\'m reading a number

4条回答
  •  情话喂你
    2021-01-18 09:57

    Using Javascript you can only count the hits from the current user, because you have to save the count in a cookie or a client side technology.

    For a more accurate way you have to use a server-side language and maybe add a storage engine like a database to make it work.

    I suggest you start here Php for beginners the link might be old but it covers all the basics you need to know to create your counter.

提交回复
热议问题