PDA

View Full Version : how to block right-click on my site



sambitha
Apr 30th, 2009, 04:27 AM
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 ,

creativhost
Apr 30th, 2009, 05:07 PM
http://www.java-scripts.net/javascripts/Right-Click-Block.phtml

that will help the right click issue. Saving the pages is hard people will just view source and copy.

semoweb
Apr 30th, 2009, 06:22 PM
http://www.java-scripts.net/javascripts/Right-Click-Block.phtml

that will help the right click issue. Saving the pages is hard people will just view source and copy.

I agree with you.
Also the javascript code wont work for firefox you can still right click. This will only work on i.e But best of luck.

happy
May 2nd, 2009, 04:20 AM
This is a cross browser DHTML script that will prevent the default right menu from popping up when the right mouse is clicked on the web page. Use it to stop surfers from easily saving your web page, viewing its source, or lifting images off your site when using either IE 4+ or NS 4+.

add the following code to the <BODY> section of your web page

<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

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>

GBHostingCo
May 16th, 2009, 11:49 PM
If your purpose of Adding in this "Right-Click Disable" Script is to "block" your source from being viewed then it's pointless. There is no way to block someone from viewing your source if it's done in complete HTML. There are so many ways to view a source code In a browser and theres also programs that can be downloaded and the user just puts your URL in and any page/image that is linked, it downloads it completely. It does a SpiderWeb effect. I personally do not suggest putting this kind of script on your site as it'd be a waste of time and no point in doing so. That is my opinion.

Jenny123
May 19th, 2009, 04:13 AM
If your purpose of Adding in this "Right-Click Disable" Script is to "block" your source from being viewed then it's pointless. There is no way to block someone from viewing your source if it's done in complete HTML. There are so many ways to view a source code In a browser and theres also programs that can be downloaded and the user just puts your URL in and any page/image that is linked, it downloads it completely. It does a SpiderWeb effect. I personally do not suggest putting this kind of script on your site as it'd be a waste of time and no point in doing so. That is my opinion.

I fully agree with this answer.

Why would you even want to do such a thing?