Javascript hit counter for a website

前端 未结 4 554
执念已碎
执念已碎 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条回答
  •  旧时难觅i
    2021-01-18 09:54

    Most sites with a counter I see with a lot of traffic use a timed counter and use ajax to get the real number upon load.

    The benefits of this is you do not have a static counter and you get the real number once you refresh but like it has been said before, with only javascript it is not possible

提交回复
热议问题