I have a web application where most of the functions are in the javascript file, and I'm going to introduce a version of the application in which registered users will have access to more functionality.
Again, the extra functionality is just the extra functionality in the javascript file.
I plan to do the following:
- link pro_script.js if the user is logged in,
or link to normal_script.js if the user is not logged in,
in the page header using user authentication with php.
I was wondering if this is the best way to approach this situation?
I have a problem that pro_script.js remains available in the javascripts folder, and it would be possible to write a script or plugin that loads pro_script.js instead of normal_script.js.
source
share