i have made a javascript to open a new window. the content of the new window is in the openwindow.document.write ..i wanna put a right click disable script inside the new window. can someone plz write the disable script inside the document.write plz!! 😮 😮 😮
below is my newwindow script and the right click disable script. plz some1 put them together plz!
newwindow script……….
<head>
<SCRIPT LANGUAGE=”JavaScript”>
function openindex()
{
OpenWindow=window.open(“”, “newwin”, “height=320, width=340,toolbar=no,scrollbars=”+scroll+”,menubar=no”);
OpenWindow.document.write(“<TITLE>Title Goes Here</TITLE>”)
OpenWindow.document.write(“<BODY BGCOLOR=black>”)
OpenWindow.document.write(“<b>blablabla</b>
OpenWindow.document.write(“</BODY>”)
OpenWindow.document.write(“</HTML>”)
OpenWindow.document.close()
self.name=”main”
}
</SCRIPT>
</head>
<body>
<input type=”button” Value=”open newwindow blablablablabla” ONCLICK=”openindex()”>
</body>
right click disable script……….
<script language=”JavaScript”>
var msg=”Right Click Disabled!”;
function disableIE() {if (document.all) {return false;}
}
function disableNS(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=disableNS;
} else {
document.onmouseup=disableNS;document.oncontextmenu=disableIE;
}
document.oncontextmenu=new Function(“return false”)
</script>