can we make the .js files in the page unreadable?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
jishcem
Forum Newbie
Posts: 12
Joined: Tue Nov 10, 2009 11:48 pm

can we make the .js files in the page unreadable?

Post by jishcem »

If any one looks at the source code of a page, they will be able to see the links of the included .js files, and when they click on them, they will be able to see the entie code of the particular .js file.


Is there any way we can prevent that files being read? I mean like doing something in Apache or something...


Thanks, Ajeesh
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: can we make the .js files in the page unreadable?

Post by kaszu »

Only thing you can do is pack (minify) your JS, then these files will be practically unreadable, but anyone with good JS knowledge still will be able to get back whatever you are trying to hide.
jishcem
Forum Newbie
Posts: 12
Joined: Tue Nov 10, 2009 11:48 pm

Re: can we make the .js files in the page unreadable?

Post by jishcem »

Thanks for reply, :)
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: can we make the .js files in the page unreadable?

Post by daedalus__ »

couldn't you use apache's access control? stick something in .htaccess?
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: can we make the .js files in the page unreadable?

Post by kaszu »

stick something in .htaccess?
what's the point of js file if it's not sent to browser?
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: can we make the .js files in the page unreadable?

Post by daedalus__ »

my brain was somewhere else :D
Post Reply