View Full Version : Embedding Script

09-01-2005, 10:31 PM
I'm incorporating a script language of "no right button" into a web page of pictures and addresses of our membership which is for membership use only. That script works beautifully on the page, however, I have a feature that allows the picture to be enlarged and the "no right button" feature is subsequently ignored. I know so very little about JavaScript that you can't even call me a novice.

The second script is used to open smaller windows with the larger picture in it.

I would like to know if one java script can be embedded in another. The copy I have below is taken directly from my page and my goal is to incorporate your script the first part into the second part and if so where would your script go into the second.

The scrript looks like this:
<script language=3DJavaScript>

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message=3D"";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if=20
(document.layers||(document.getElementById&&!document.all)) {
if (e.which=3D=3D2||e.which=3D=3D3) {(message);return false;}}}
if (document.layers)=20


document.oncontextmenu=3Dnew Function("return false")
// -->=20
<!-- Begin to hide script contents from old browsers. =20
function prizewin(file, anchor) {
var url =3D file;
if (anchor) url +=3D "#" + anchor;
infowindow =3D window.open (url, "infowindow",
infowindow.focus ();
} =20

In advance I would like to Thank You for your help.

09-02-2005, 08:30 AM
I don't know what on earth is going on there with all the 3D's, but they've borked the script up nicely.

Anyway, if you're looking to put a no-right-click script on your page, I'd strongly advise against it. Every one is avoidable, and they're frankly pointless.