Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

live counter of users present on a website

After seeing an interesting function on this site (https://cssbattle.dev/#:~:text=96,Online), I wondered how I could program a live counter that indicates the number of users present on the site WITHOUT using a server or things like that. Does anyone have any idea how one could program something like this using just HTML, CSS or JS?

I know a little about JS, do you have any advice?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It is not possible to count "online users" without a component which keeps track of users which have requested the resource (like your web page). And users/browsers do not talk to "each other", so there is no communication between users/browsers as well (which maybe could be used to "count" online users).

You need some kind of server component to count online users. It can’t be done with HTML, CSS and JavaScript alone.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading