how to block right-click on my site
Hi, anyone can help ?
i want to Block right-Click when some one visit My Website and also don't allow to save the Web Page ,
is it possible to do it with Simple HTML code ?
any help appreciated ,
Hi, anyone can help ?
i want to Block right-Click when some one visit My Website and also don't allow to save the Web Page ,
is it possible to do it with Simple HTML code ?
any help appreciated ,
pr0gr4mm3r posted this at 11:07 — 20th April 2009.
He has: 1,502 posts
Joined: Sep 2006
Something like this script might help you out. A Google script turned up several more results. Some are probably better than others, and make sure they work in all browsers.
stevejeff posted this at 11:31 — 20th April 2009.
They have: 17 posts
Joined: Apr 2009
A good anti-right click script can be found here: http://javascript.internet.com/page-details/no-right-click.html
That'll probably work for most of what you want to do.
articlemaster posted this at 12:41 — 20th April 2009.
They have: 83 posts
Joined: Apr 2009
Simply add the following code to the section of your web page.
<script language=JavaScript>
<!--
//Disable right mouse click Script
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
Hope This Will Solve Your Problem.
Thanks.
Megan posted this at 14:49 — 20th April 2009.
She has: 11,421 posts
Joined: Jun 1999
You know that people can stil save the page with file > save as, right?
Blocking right clicks with Javascript isn't going to stop people from stealing your content if they really want to. It's really just going to annoy people who want to use their right click context menu for other tasks.
Megan
Connect with us on Facebook!
greg posted this at 15:58 — 20th April 2009.
He has: 1,581 posts
Joined: Nov 2005
I totally agree with Megan.
Right click is often useful for various things, and people who steal code and content will know the various ways around a mouse right click being disabled anyway.
Highlighting code and pressing Ctrl C (copy), using Firefox's Firebug to simply copy all code, as well as various other methods.
So not only do you remove functionality from all your visitors but you also add more code that needs to be loaded, and all this to stop (realistically) no-one.
It's pointless in 99.9% of cases, but you have some good examples if you still want to do it.
Greg K posted this at 21:22 — 20th April 2009.
He has: 2,145 posts
Joined: Nov 2003
As I always tell others when asked:
The only people you are going to stop with this method are people who will not be any threat to using your files. Pretty much if its transmitted to my computer for me to view it, I can capture it.
-Greg
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.