mediagirl
asked on
code to disable right click and view source
Previously submitted in Java but was told I should try a different category. Someone please advise if I have selected the wrong category. Thanks!
Could someone please forward me the code to disable view source and to also disable right click? I need this to work cross-browser 3.0 and up. Thanks.
(example exists at http://www.dotcomguy.com then click to watch him live. If you right click on the screen, a java window pops up thanking you for your support then you have to click ok to resume view. I believe the view source is disabled just by doing a javascript launched page and disabling tool bars but the right click thing has me stumped)
Could someone please forward me the code to disable view source and to also disable right click? I need this to work cross-browser 3.0 and up. Thanks.
(example exists at http://www.dotcomguy.com then click to watch him live. If you right click on the screen, a java window pops up thanking you for your support then you have to click ok to resume view. I believe the view source is disabled just by doing a javascript launched page and disabling tool bars but the right click thing has me stumped)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks bud. I appreciate your preciseness and speed of an accurate response!
Why would you want to disable right-click? Just think about how often the right-click (or left-click - lefties) is used.
If the code (JavaScript mostly) or images are to be protected then put in some copyright notices. Disabling right click I think is unprofessional and a sign you don't trust your visitors or clients.
If you want to protect something that badly, why have it on the web?
If the code (JavaScript mostly) or images are to be protected then put in some copyright notices. Disabling right click I think is unprofessional and a sign you don't trust your visitors or clients.
If you want to protect something that badly, why have it on the web?
<html>
<head><SCRIPT LANGUAGE="Javascript">
<!-- Hide from old browsers
function doNotSelect()
{
return false;
}
document.onselectstart = doNotSelect;
// End Hide -->
</script>
</head>
<BODY OnLoad="doNotSelect()" onClick="doNotSelect()" onRightClick="doNotSelect(
Test
</body>
</html>