Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Codeproject,

I wasn't sure what these are called. I'm new to PHP/JS/HTML and I'm trying to make a counter - not a visitor counter, but a function counter. I want to be able to log how many times my Javascript function search() has been called, and then display the counter in a dynamic fashion(updates for everyone once someone else has used search().

* Does anyone have any ideas on how to go about doing this?
* Is it possible to execute <?php ?> inside a or .js file?

Regards,
- Eddie

What I have tried:

Tried looking at visitor counters, but they use cookies and I do not want to use these.
Posted
Updated 1-Jul-17 17:35pm

1 solution

1. As an alternative to cookie, check out HTML5 Local Storage[^]
2. Never never couple client-side script (JS) with server-side one (PHP) - if one breaks, all hell breaks loose too! Instead, consult Google on the use of AJAX.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900