Disable right clicking on page

47 views

This trick disables the right click on your web page . It is tested on IE and works fine.. Here is the code:

<SCRIPT language=”JavaScript”>
<!–
var message=”Put here the text you want to display when you right click”;
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// –>
</SCRIPT>



« Links without underline PHP - make webpage password protected »
Posted on Saturday, March 7th, 2009 at 5:43 pm under HTML Tips and Tricks | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?