Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prevent download of .js files

Status
Not open for further replies.

SM777

Technical User
Joined
Mar 7, 2001
Messages
208
Location
GB
is it possible to stop javascript files from being downloaded?

if I type
my browser offers me the choice to download goodie.js

how can I stop this? I tried changing the permissions of the dir and the file but then the scripts wouldnt run.
 
Whereever the file exists, if it need to be called by your page then it will be able to be read by the user as the file will require read permissions
 
if you are trying to hide your source code then don't bother trying. It is impossible to make it 100% safely hidden.

I can crack almost any hiding techniques in less then 10 minutes and I am not in any way endowed with some hability that the next guy would have just by searching through google. Gary Haran
 
Besides, when the web page is viewed on the user's computer, the external JS file is already in the Temporary Internet Files/Cache. The only way to prevent downloading your code is to use ASP and make everything server side. This, of course, does not work with JS that has to execute on the page after the page is created on the client computer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top