harleychick
Programmer
I have a webpage MessageBoard.htm. It contains two frames, a header frame and a main frame. I have a no right-click script in the header section of this page that prevents the user from right-clicking on the header frame. The main frame content MessageDoc.htm is overwritten daily; so, if I add the no right-click script to the header section of the MessageDoc.htm page (source of the main frame), it gets overwritten. How can I add code to the MessageBoard.htm page to prevent users from right-clicking on the main frame content (MessageDoc.htm)?
Thanks in advance,
HarleyChick
Here's the code I have for MessageBoard.htm:
<html>
<head>
<script language="Javascript1.2">
// (C) 2004 CodeLifter.com
//============================================================
//Script: Basic No-Right-Click Script
//Functions: Blocks right-click on mouse but does *not* show
// an alert box or message.
//Browsers: All (4.X and later)
//Author: etLux
//============================================================
//Put the following script in the head of your page:
function nrcIE(){
if (document.all){return false;}}
function nrcNS(e){
if(document.layers||(document.getElementById&&!document.all)){
if (e.which==2||e.which==3){
return false;}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=nrcNS;
}else{document.onmouseup=nrcNS;document.oncontextmenu=nrcIE;}
document.oncontextmenu=new Function("return false");
</script>
<title>Message Board</title>
<base target="_top">
</head>
<frameset rows="16%,*">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
<frame name="header" scrolling="no" noresize target="main" src="contentheader.asp">
[COLOR=red yellow]<frame name="main" src="bulletin/MessageDoc.htm" target="_self" scrolling="auto">[/color]
</frameset>
</html>
Thanks in advance,
HarleyChick
Here's the code I have for MessageBoard.htm:
<html>
<head>
<script language="Javascript1.2">
// (C) 2004 CodeLifter.com
//============================================================
//Script: Basic No-Right-Click Script
//Functions: Blocks right-click on mouse but does *not* show
// an alert box or message.
//Browsers: All (4.X and later)
//Author: etLux
//============================================================
//Put the following script in the head of your page:
function nrcIE(){
if (document.all){return false;}}
function nrcNS(e){
if(document.layers||(document.getElementById&&!document.all)){
if (e.which==2||e.which==3){
return false;}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=nrcNS;
}else{document.onmouseup=nrcNS;document.oncontextmenu=nrcIE;}
document.oncontextmenu=new Function("return false");
</script>
<title>Message Board</title>
<base target="_top">
</head>
<frameset rows="16%,*">
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
<frame name="header" scrolling="no" noresize target="main" src="contentheader.asp">
[COLOR=red yellow]<frame name="main" src="bulletin/MessageDoc.htm" target="_self" scrolling="auto">[/color]
</frameset>
</html>