Put this code on your blog or your site. And Put some words on "Put your message here" <script language=javascript> <!-- http://www.spacegun.co.uk --> var message = "Put your message here"; function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; } if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } } document.onmousedown = rtclickcheck; </script>
90% of Web Masters who use such a code to protect their HTML Source or Images have nothing worth taking. The best form of protection is a legit copyright and not caring...
By definition, your site MUST be downloaded to the users computer BEFORE it can be viewed in his browser. Once it is on his computer, YOU CANNOT PREVENT HIM FROM COPYING IT. All you can do is slow him down. If you are so paranoid that you do not want your stuff copied, DO NOT PUT IT ON YOUR WEBSITE.
Agreed. And the people it slows down are the people who aren't swift enough to know how to use it anyway.
Agree with you as well. This code won't do to much and your better off just copyrighting the content on your page and if someone takes it go through all the legal stuff as this code won't do much to protect the source code.
A lot of people (more than you might think) surf with JS disabled, so this code would have no affect whatsoever anyway
Oy gevalt, this cockamamie nonsense again. No, you can't protect it... as mentioned JS off, this script is nothing more than pointless bloated idiocy... It does bupkis in the way of protection -- much less the code for it being a decade out of date... being invalid strict, using the outdated language attribute, checking by browser instead of by capabilities, and putting values into the global namespace; Welcome to 1997... IF one wanted to implement that, it should look something more like this for 2011: <script type="text/javascript"> document.onmousedown=function(e) { if (!e) var e=window.event; if ( ((e.which) && (e.which==3)) || ((e.button) && (e.button==2)) ) { if (e.preventDefault) e.preventDefault(); e.returnValue=false; alert('Your messaage here'); return false; } return true; } </script> Code (markup): Though again, intercepting right clicks that way is pointless since it's ridiculously simple to bypass -- turn javascript off, save as MHT, document->size in the web developer toolbar... firebug/dragonfly inspection of elements... Or browsers like Opera that allow you to prevent scripts from intercepting right mouse clicks... Anyone who tells you this type of script offers any real protection is blowing so much sand up yer tuches you could change your name to Sahara.
I'm willing to bet over 98% of your real visitors (bots excluded) all have JavaScript ENABLED. I can't think of a single popular website that doesn't provide use of the scripting language.
Tell that to the million and a half people who downloaded the noscript plugin for Firefox... tell it to every single Opera user who uses the in-build per-site blocker. I actually was arguing that with a guy the other day who said 100% of his visitors had scripting enabled... I pointed out he was relying on a analytic package that only works when scripting is on... That was good for a laugh.
Disabling right Click on your site help your visitors to get annoyed and will not put you in trusted vendor list. So no need to stop copying your content just go for Copyrighting. Coz who need your content can grab it through source code.
What deathshadow said - and I'm still laughing. 100% of people who visited the site with JS enabled had JS enabled? Reminds me of a sign on I-95. Something to the effect of "Joes Burgers - the best burger joint in Smalltown" (real names changed to protect the brain-dead). And how many burger joints are there in Smalltown? One.