Jump to content

Preventing detecting direct access to a file


php_joe

Recommended Posts

I have a JavaScript code on an external file that I'd like to keep private.

 

I know that I can use htaccess to block direct access to the folder, but:

 

1. Will that prevent them from saving the file using "Save As"?

2. Will that prevent the index page from calling it as an external javascript file?

 

Is there any additional methods that I can use to prevent people from viewing or saving an external javascript file?

 

Thanks in advance,

 

Joe

yes it will prevent the script from being able to call it.. u cant keep javascript private because it is client-side. the browser must have js enabled and be able to interpret it.... you can make it rather obscure if u really want to. best bet is not to put anything in js that you dont want ppl to see.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.