How to hide js and js files from source

how to hide js and js files from source code

i found Javascript Obfuscator but it will be ok with my JS source code

what about other files

I want these files not to be displayed if other users are looking at the source

    wp_register_script('dataTables.min.js', 'https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js', array('jquery'), true);

    wp_register_script('customjs.js', get_template_directory_uri() . '/js/customjs.js', array('jquery'), true);
    wp_enqueue_script('customjs.js');
    wp_enqueue_style('dataTables.min.css');
    wp_enqueue_style('buttons.dataTables.min.css');

      

+3


source to share


2 answers


You can read this post . However, you can compile all your javascript or CSS or even HTML code using gulp or grunt . Using these features, you can optimize your page, you can evade scripts. That being said, they can't read the source code easily, but they can still copy it, but still. There is no point in doing this as the user can disable javascript in the browser and there are many tools that users can use to see the source code.



+2


source


You cannot hide your js files and libraries when in view mode. However, you can minimize and guess them to make them difficult to read.



+2


source







All Articles