Disabling the Right Click on the Page prevent to view the source code using JavaScript.

Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 576
Below is the JavaScript code to disable right clicks on the page and prevent to viewing the source code.
on onmousedown event,we have to call below function:-
<script language = "JavaScript" type = "text/javascript">
var message = "";
function Disable_Right_Click(keyp)
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2)
alert('Right click has been disabled'); return false;
document.onmousedown = Disable_Right_Click;

Comments or Responses

Login to post response