How we can hide javascript/jQuery cotents/code from others?
i want to hide javascript from user/anyone when someone want to viewsource of page.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ajeet MishraPosted Sep 24, 2015, 1:43 AM
Manoj BhoirPosted Sep 23, 2015, 11:06 AM
Short answer: You can't/don't.
Longer answer: You cannot hide it at all. It runs on the client and it cannot be compiled to machine code. However, you could minify it - that's basically obfuscating it by shortening variable names, removing whitespace, etc. While it's usually used to save bandwidth it also makes the code less readable. Note that all but the changed variable names and removed comments can be easily undone by something like jsbeautufier. but for a large application it's very hard to understand the code without any meaningful variable/function names or comments.