The best way to protect your javascript code

A while ago, I have tried to protect my javascript code by using different obfuscation tools but every time I have found also a tool to unobfuscate my obfuscated code.

Today I want to show you an easy and a very efficient way to protect the javascript(jquery, angular, etc) code. To protect our javascript code, we need only to include all js code in a php file.

javascript code without <script> tags

Next, we can call this code by using jquery:


You can customize the php file by adding more argument: referer ip, information about the referer server, etc.


Leave a Comment