shetlandbob
Programmer
Hi I've got the following code that I believe will disable the right click on a html page
If I put this in the <head> section of my file then it works for that page.
My page is build up with frames, can I put this in my frames.html so that the rule is valid for all child.html pages???
I do not want to have to put it in all my child html. Also in some frames I will load up a picture and not a html so how can I disable the right click in that instance?
Thanks
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var message="Right Click Disabled"
function click(event)
{
if (document.all)
{
if (event.button == 2)
{
alert(message);
return false;
}
}
if (document.layers)
{
if (event.which == 3)
{
alert(message);
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//-->
</SCRIPT>
My page is build up with frames, can I put this in my frames.html so that the rule is valid for all child.html pages???
I do not want to have to put it in all my child html. Also in some frames I will load up a picture and not a html so how can I disable the right click in that instance?
Thanks