Return to Snippet

Revision: 5601
at March 18, 2008 13:18 by localhorst


Initial Code
// this needs mootools framework and disable rightclick or better the contextmenu
document.addEvent('contextmenu',function(e){
				e=new Event(e);
				//alert('success');
				e.stop();
			});


function selectnone() {
    document.body.ondrag = function () { return false; };
    document.body.onselectstart = function () { return false; };
		if(window.ie || window.opera){document.body.setProperty("unselectable","on");}
    if(window.gecko){document.body.setStyle("MozUserSelect","none");}
    if(window.webkit){document.body.setStyle("KhtmlUserSelect","none");}
		
}


// call selectnone() onload/domready

Initial URL

                                

Initial Description
I know what you think - no discussion about this needless piece of code to prevent copying texts/images from websites, but there are customers outside that are advising resistant and so I use this code to scare off their potential clienteles.

Initial Title
website copy protection

Initial Tags
copy

Initial Language
JavaScript