Javascript Reference
Categories: tips

javascript forbid to use right click/save/select/paste

@March 23, 2008, 1:51 p.m.
Forbid to use mouse right click:
document.oncontextmenu = function() { return false;}

Forbid to save webpages:
<noscript><iframe src="*.htm"></iframe></noscript>

Forbid to select text:
<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()>

Forbid to paste:
<input type=text onpaste="return false">

Powered by Linode.