disable context menu bar in browser

M

Matt

I want to disable context menu bar in browser, and I do the following
by copying a code in net, it is working though, but I just don't
understand what is new Function here means, can anyone advise?
thanks!!

document.onselectstart=new Function ("return false");
 
K

kaeli

I want to disable context menu bar in browser, and I do the following
by copying a code in net, it is working though, but I just don't
understand what is new Function here means, can anyone advise?
thanks!!

document.onselectstart=new Function ("return false");


It just reassigns the event a new handler that does nothing at all, basically
cancelling the event. I don't think it's cross-browser.

Disclaimer / my 2 cents: In the vast majority of cases, doing what you're
doing is at best a Bad Idea and at worst illegal (UK internet accessibility
law). Most people reassign the context menu to try to keep people from
stealing things. That's so ineffective, it's laughable, and it irritates
legit users. The only reason you should be re-assigning the context menu is
to provide a better one for an intranet application. Since I don't know what
you're doing, this comment should be taken in general, not specific to you,
so don't get your panties in a wad. ;)

HTH

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top