Welcome to WebmasterWorld Guest from 54.225.6.51

Forum Moderators: open

Message Too Old, No Replies

Hiding a .JS file

     
2:56 pm on Dec 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


Is it possible to hide a .JS file or at least prevent it from being downloaded when a page is saved?

-s-

3:03 pm on Dec 13, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 28, 2002
posts:492
votes: 0


There will probably not be a safe way, because the file will have to be transferred to the users computer to be executed.

You could test if the request for the .js file has a referrer from a legitimate file, and deny it otherwise, but it is not foolproof. Some browsers and proxies doesn't send the referrer header, and it can be faked.

So, something can be done, but nothing that is perfectly safe.

René

3:09 pm on Dec 13, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 13, 2002
posts:2162
votes: 0


If you really want to protect the code, I would put it in the page and encrypt the whole page,

Still not 100% foolproof - and no SE friendly.