I know some of you just feel it is as a completely wrong question but I have a few requirements of such kind that’s why I am asking this question. I understand that javascript is downloaded by the browser on client side so it’s very difficult to hide that.
So now i have a game code completely written in jquery and i want that the user is not able to see the complete code because:
-
The owner of the games doesn’t want to show the game code to the user.
-
If a clever user reads the code carefully then he/she might be able to solve the puzzle(it’s a puzzle game).
So, is it good enough to use google closure compiler or yui compressor to make the code unreadable & secure for the above requirements?
If you think that it’s not possible to do this in the situation then please suggest me any other way of doing this. Do I need to completely rewrite the game code into a server side language then convert it to js using some tool?
Javascript is a client language, for that, you will always need to show the code to the user.
What you can do is compress and minified…
same thing as all Javascript Frameworks outthere, check this original version and compare with the minified and compressed version