homepage Welcome to WebmasterWorld Guest from 54.166.113.249
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Hiding a .JS file
stcrim

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 246 posted 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

10+ Year Member



 
Msg#: 246 posted 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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 246 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved