|
Home > Archive > Certified Internet Webmaster - CIW > July 2001 > Need Help
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| The other day I went to a few websites where the source option was disabled. How is that done? Is there a certain WYSIWYG editor that disables the source from being accessed?
Thanks | |
|
| You can do it with JavaScript I think, although I consider this sort of thing to be kind of lame. You can disable right-clicking or menus in this way. The script will look something like this:
<!-- 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(" HA!!! No copying, you freeloader.");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// End -->
This will diable right-click. Source can be disabled in a similar manner, I think. | |
|
| Do you insert it in <head> or <body>? | |
| cboyles 2001-07-10, 1:38 am |
| Load it in the head, and set the calling statement in the body to run the function onLoad
<body onLoad="superFlyDisableRtClick()">
Cheers |
|
|
|
|