Is it possible to have clients have access to load a javascript but still be denied access from accessing the page that it is stored on?
This is not possible. Because Javascript is client-side, there is no way to prevent a client from viewing your source without blocking them from using it.
Minification and obfuscation can make it more difficult to discover what is going on in your code, but someone can use a tool like jsbeautifier to thwart your efforts.
You can protect yourself with a license (which you should do, both for yourself and others), but you cannot "lock down" JS in the way that you might with server side languages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With