Skip to content
Advertisement

How to prevent users from copying content from website

Is there any way to prevent users from copying content from website and display encrypted code in view source?

I know that techies will always find a way but if it prevents normal users it’s OK.

Advertisement

Answer

Check out ionCube HTML Obfuscator:-

http://www.ioncube.com/html_encoder.php

As of the text contents, Try this code:- Live Demo (IE isn’t supported)

<script type="text/javascript">
document.oncopy = function(){
    var bodyEl = document.body;
    var selection = window.getSelection();
    selection.selectAllChildren( document.createElement( 'div' ) );
};
</script>
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement