-1

I had developed a web application using html,javascript and servlets...

Ext/index.html this is the welcome file

in this html file i had linked javascript files using script tag

when i changed the path to Ext/javascriptfile.js

file is getting accessed how to restrict that....

Surya Prakash Tumma
  • 2,153
  • 4
  • 27
  • 47
  • So, you have **client side code** that you want to make inaccessible for the client? How would that help? You might as well not link the javascript at all and move it to a non-www directory then. – Oldskool Jan 02 '13 at 09:53
  • What do you mean file is getting accessed? WHo is accessing the file now ? – Ravi Y Jan 02 '13 at 09:53
  • Try this http://www.ducea.com/2006/07/21/apache-tips-tricks-deny-access-to-certain-file-types/ – Behroz Sikander Jan 02 '13 at 09:58

1 Answers1

1

If some code in this file is to be executed at some point in your page, you just can't.

Your browser needs access to this code in order to execute it. If your browser can access it, you can. Restrict access to client side code is an nonsense, as it is intended to be used by client.

But if you want to make your code unreadable, you can still try to obfuscate it.

Community
  • 1
  • 1
xlecoustillier
  • 16,183
  • 14
  • 60
  • 85