Right click message
Andy is right...
But...I think that a better way to "protect" the code is to try this script using frames. Coz you ve got to right click / view framesource in order to steal the code.
However, someone can easily steal your code either by disabling jscript or by viewing the cached .html
Coddy
Brooke posted this at 13:50 — 15th February 2000.
She has: 681 posts
Joined: Feb 1999
I know someone recently asked this question - but I can't seem to find the answer.
If you have a button, banner, whatever it might be on your site, that you want to have a javascript pop up to come up when someone right clicks...how do you do that?
Here are a few examples: http://www.sunapp.com/
(try to click on one of his banners in the middle of the page)
I don't want to say that same thing - but just a message that says you don't have permission to use this item.
Any ideas?
Brooke
------------------
Providing quality websites for businesses and individuals!
www.cataluna.com
Anonymous posted this at 14:21 — 15th February 2000.
They have: 5,633 posts
Joined: Jan 1970
If you look at the source from that page you can see his code if you want to use it, but i advise you not to because more experianced users like to right-click on links and open them up in multiple windows etc......in short, people find that stuff annoying and it is unneccessary to do it because one can still view the source easily!!
------------------
Join The Rest Of The Webmasters On The Net!!
Contact Me:
[email protected]
ICQ: 52790444
Brooke posted this at 15:51 — 15th February 2000.
She has: 681 posts
Joined: Feb 1999
Really great point. I created a very generic banner for a client of mine and they were concerned that people would steal it without permission. That's why they suggested this. And I just wasn't thinking that someone could still take it!
Thanks!
Brooke
------------------
Providing quality websites for businesses and individuals!
www.cataluna.com
AndyB posted this at 16:24 — 15th February 2000.
They have: 344 posts
Joined: Aug 1999
Well, here's the script that was used on the 'no right clicks' page you pointed us too.
There are millions of variants to this, many of which work with both NS and MSIE. In this example you could change the variable 'msg' so it says what you want.
DO NOT STEAL THE CODE
function right(e) {
var msg = "A'vast ye scurvy dog! Don't be taken me stuff without permission!";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
else
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
return true;
}
document.onmousedown = right;
And just how did I get that from a 'no right clicks' page - browser toolbar EDIT >> VIEW SOURCE !!
So the no right clicks thing is a pretty trivial scheme.
AND - since before I can view any page on my PC all the content needs to be downloaded to my PC (cache), I could copy whatever I wanted to no matter what 'protection scheme' you implemented.
The only real protection is digital watermarks and millions of lawyers/dollars.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.