Javascript hit counter for a website

前端 未结 4 523
执念已碎
执念已碎 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:42

    Javascript is a client side scripting language - it runs on client pc. The counter itself must be implemented at the server side, since you have to count http requests. The javascript code though may request the server to update the counter at the html page displayed at client's pc.

提交回复
热议问题