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.
You can't ever disable it.. users can view the source of your page so the text is always available. If you put click handlers to disable right-click, they can turn javascript off.. The best you can try to do is make it inconvenient for people to deter them, but never can you prevent them.
In general, the answer is no. This means you are claiming credit for someone else's work and is called plagiarism. It's illegal. If you publish someone else's work without the appropriate licence or permission you are committing copyright piracy. It's also illegal.
You can use jquery for this: $('body'). bind('copy paste',function(e) { e. preventDefault(); return false; });
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With