[thelist] Preventing right-clicking on a page?

Benjer futureweb at macmail.com
Mon Oct 14 10:47:01 CDT 2002

On a mac http://spider-food.net. Using control click (same as right click)
gives the normal options...

On 14/10/02 5:37 pm, "Bob Haroche" <spambait at onpointsolutions.com> wrote:

> I agree with all the others about not disabling the right click. One
> additional reason is that, if I were the client and came across that script,
> I'd think you don't trust me -- which of course you don't. Perhaps not the
> best way to manage client relations.
> Nonetheless, since you asked here's a sample javascript for you:
> <!--
> var message="Sorry, right clicking is disabled.";
> function click(e){
> if(document.all){
> if(event.button==2||event.button==3){alert(message);return false;}}
> if(document.layers){if(e.which==3){alert(message);return false;}}}
> if(document.layers){document.captureEvents(Event.MOUSEDOWN);}document.onmous
> edown=click;
> //-->
> Perhaps a better way to implement the disabling is to install a "useful"
> right click widget as was done at http://spider-food.net. I personally think
> that widget is a *bad* thing because it confounds user's expectations and
> deprives them of normal functionality but in this case it might alleviate
> the appearance that you're simply doing this out of lack of trust.
> ---------------
> Regards,
> Bob Haroche
> O n P o i n t  S o l u t i o n s
> www.OnPointSolutions.com

futureweb at macmail.com

More information about the thelist mailing list