Bharanikumar
Bharanikumar

Reputation: 25733

How to block others access JavaScript

Possible Duplicate:
Protecting client side logic & data

How can I block other from reading my JavaScript through view source?

My thing is, now one can access my JavaScript, because am not sure, but just guess some one from outside using some tool to changing my JavaScript events.

So how to make the authenticated?

Upvotes: -1

Views: 180

Answers (2)

Shamim Hafiz - MSFT
Shamim Hafiz - MSFT

Reputation: 22064

It's not entirely possible for you to block your JavaScript code from getting into the client side, since this is where they will get executed. As you mentioned about changing the events, your Application must be developed in a such a way that such changes will not harm the Application at the server end. Of course, that particular user will be able to produce unanticipated output it his end, but these should hardly matter as he will be the sole viewer of those.

One side note though, there is something called code obfuscation, that is making the code deliberately unreadable. Some Web App developers resort to that. You could consider doing that.

Upvotes: 1

Bruce Armstrong
Bruce Armstrong

Reputation: 1602

You don't control the client, and javascript isn't compiled. Its a losing battle if you want to lock it down completely. The best you can hope for is a good obfuscator/compressor that would make it more difficult to read. You can also do it all in flash or something where you would have a bit more say, but you still don't control the client, and they can still decompile the source.

Upvotes: 3

Related Questions