Hi,
This is my first post. I need help in disabling right click and print screen in my website. Is there any scripts for this or how can I control it.
Venu.
My Website
Hi,
This is my first post. I need help in disabling right click and print screen in my website. Is there any scripts for this or how can I control it.
Venu.
My Website
Put this code into a javascript in your heading
<!--
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
-->
And expect it to do what, exactly? Protect content? Not a chance.Originally Posted by Dance10Looks10
To the OP: read around. Content cannot be protected on the Web. People that might take it for redistribution (rather than personal use, which shouldn't be an issue) know how to get around any trick you try to use. The end result is stolen content, but legitimate users that can no longer use their browser properly.
Watermark content, or reduce its quality. Make sure that there's no point in redistribution.
Mike
The question was how to disable the right mouse button and not prevent hijacking of code.
The code I put in does indeed disable the right mouse click. After that, this User is on their own in terms of theft prevention which wasn't mentioned in the original question of "How can I disable the the right mouse?"![]()
Where did I mention anything about code?Originally Posted by Dance10Looks10
The OP has a gallery, and the Print Screen key was explicitly mentioned. It doesn't require a great leap in reasoning to anticipate that the OP is trying to protect either those photographs, or other content elsewhere within the site. Suggesting what you did will give the illusion (and it is just an illusion) that such efforts actually achieve something worthwhile. They do not.
No. In some instances it may disable the context menu, but it is far from guaranteed. Even then, it is trivial to disable the script itself. Now read the second paragraph in my previous post, with emphasis on the enclosed phrase.The code I put in does indeed disable the right mouse click.
I prefer not to intentionally mislead those that ask for help.After that, this User is on their own in terms of theft prevention [...]
Mike
you can always when thy right click. give them a note witch says contact webmaster or artist.etc..
<SCRIPT TYPE="text/javascript">
var message="Please email the Artist for your interest .";
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
</SCRIPT>
If you want to provide arrangements for users to legally obtain copies of artwork or other media, then that should be displayed as text on the page. Stop trying to interfere with the user!Originally Posted by webtech
Your code doesn't work in Gecko-based browsers (and others), by the way.![]()
Mike
Put that in the address bar of your favourite Javascript-enabled browser, then press enter. Ta-da, instant unprotected images. The above will disable all scripts and HTML, except the images. The moral of this story, folks, is that you can't use client-side scripting to disable anything. Client-side scripts are on the user's computer. What the user holds, the user controls. For that matter, the images have already been downloaded onto the user's computer and can be accessed from the browser's cache directory.Code:javascript:html="";e=document.images;for(j=0;j<e.length;j++) html+="<img src=\""+e[j].src+"\"/> </img>";void(document.body.innerHTML=html);void(document.getElementsByTagName("script")[0].innerHTML = "");
Last edited by Twey; 10-04-2005 at 04:34 PM. Reason: Whoops, the forum doesn't like e[i].
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
if you website is made of tables change the img src="asdjgnbajdrbg" to background="dsbfiadbgviabg" and peeps can't copy
One should consider getting with the times.Originally Posted by Hybrid
Rubbish.change the img src="asdjgnbajdrbg" to background="dsbfiadbgviabg" and peeps can't copy
Mike
Bookmarks