homepage Welcome to WebmasterWorld Guest from 23.22.102.9
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library : Charter : Moderators: whoisgregg

JavaScript and AJAX Forum

    
Hiding a .JS file
stcrim




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

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

-s-

 

seindal




msg:1494043
 3:03 pm on Dec 13, 2002 (gmt 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é

aspdaddy




msg:1494044
 3:09 pm on Dec 13, 2002 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved