views:

45

answers:

2

Possible Duplicate:
Protecting client side logic & data

Hi ,

How to block other reading my java script through view source,

My thing is, now one can access my java script,

bcoz am not sure, but just guess some one from outside using some tool to changing my

javascript events,

So how to make the autenticated ,

+3  A: 

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.

Bruce Armstrong
+1  A: 

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.

Gunner
in my interview they asked this question, i said no, but they said somthing like , using event binding , we can restrict others using our script,
Bharanikumar
I once saw someone disable the showing of options that come up by clicking the right mouse button on the browser. It was done by executing some kind of script. But this too isn't fool proof to prevent user at client end from seeing the JavaScript codes.
Gunner