Hey,
Just a quick Q, how do I disable right clicking on objects in a web page, what is the raw html code?
Printable View
Hey,
Just a quick Q, how do I disable right clicking on objects in a web page, what is the raw html code?
<SCRIPT LANGUAGE="JavaScript">
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { bye() }
alert("hi");
times++ } }
function bye() {
alert("BYE :)");
bye() }
</SCRIPT>
netscape code....works good and allows no right click at all...
<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// End -->
</script>
from lenshell.com
Here is a quick tip for you. Visit www.bonfire.0catch.com enter then try the right click. Yes you will get a message. Then Go up to VIEW in you toolbar and click on Source and you will see.
hmmm... I wonder what the hell is wrong with my hosting company now?
Works for me.