-1

Is there anyway to hide or secure my javascript code. Because anyone can easily see my javascript logic on my website using view page source and it's harmful for me. Please tell me any method you know for securing the javascript code or for making it difficult to understand using any encryption method with cannot easily decrypt.

4
  • Nope, it can't be done. If you want to hide it, you need to do something server-side. Commented Sep 9, 2015 at 16:22
  • If you need to do things with private code, do it on the server. If the browser can run the JavaScript, a person can see it. Commented Sep 9, 2015 at 16:22
  • You can't. One the JavaScript hits my browser, I can see it and do what I want with it. Commented Sep 9, 2015 at 16:22
  • thanks dud it's really helpful. Commented Sep 9, 2015 at 16:25

1 Answer 1

6

You can't. Don't put sensitive code, keys, information, or logic on the client. The only thing you can do is make it harder to read by running your code through an obfuscator.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.