If you want to secure your website with JavaScript no right click ,no copy text , block the view source in the browser (CTRL + U).
You are worked hardly to place the content in the your site. But some one easily stolen the content just copying from your website or from the view source and some experts may use right click in your site and stolen the your documents links from your site also.
To Prevent these type of attacks from your website. Copy and paste the following code, and make sure it place in the above </Head> tag.
You are worked hardly to place the content in the your site. But some one easily stolen the content just copying from your website or from the view source and some experts may use right click in your site and stolen the your documents links from your site also.
To Prevent these type of attacks from your website. Copy and paste the following code, and make sure it place in the above </Head> tag.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/JavaScript">
var message="NoRightClicking";
function defeatIE() {if (document.all) {(message);return false;}}
function defeatNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;}
else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;}
document.oncontextmenu=new Function("return false")
jQuery(document).ready(function($){
$(document).keydown(function(event) {
var pressedKey = String.fromCharCode(event.keyCode).toLowerCase();
if (event.ctrlKey && (pressedKey == "c" || pressedKey == "u")) {
return false;
}
});
});
</script>
* If you like this post please don’t forget to subscribe Technoise - programming blog for more useful stuff
0 comments:
Post a Comment