PDA

View Full Version : Javascript Counter Needed



Robert_B
09-10-2018, 09:05 PM
Does anyone know of a really good javascript event (i.e. onclick) counter that stores the count in a unique file?

I need one that I can invoke from either html or a javascript routine, that reads a file, increments the count, and stores the new count back in the file, and not interfere with the operation of the html code.

I've tried gcount, but it takes the focus away from the html page while it's doing its thing.

The counter doesn't necessarily have to be javascript, itself, although, that would be nice.

Thanks,
BK

keyboard
09-11-2018, 02:07 AM
Hey Robert.
I'm a little bit confused by what you're asking sorry.

Generally you can't read/write files on the clients computer with Javascript. You can store information in cookies/web storage though. Is that what you're looking for?

What is gcount sorry? I've not heard of that in relation to Javascript.

Also could you explain why you want this? It might be easier to help if we know exactly what you're looking to do.

Thanks!

Robert_B
09-11-2018, 01:08 PM
Keyboard.

Sorry if I wasn't clear. I'm looking for an event counter that will run on the server, and can be invoked from a javascript function. Perhaps I should have said hit counter, although I want to use it in a more general way. I want to be able to specify the file that gets updated, so I can count events such as particular onclicks.

gcount is a php counter that I found on php junk yard. It works, but takes the focus away from the webpage when it updates the file. It only does that if invoked from javascript. If it's invoked from html it doesn't do that.

Hope this clears things up.

B.K.