Block js file access from webpage source
I have some js files which should not be viewed by any users accessing my website i.e I don't want the contents of the js files to show up on the page source. The data is important so i don't want users to access at all. Is there any way i can do this ? Or is there any way to encrypt the js file so that I can still access the data inside, but not the users ? Or can I do some safe redirection on clicking the js file ?
You can't deny access to your JS files but you may consider minifying/obfuscating your JS files to make harder for people to understand.
Check these minifier/obfuscator