disable context menu bar in browser

Discussion in 'Javascript' started by Matt, Sep 2, 2004.

  1. Matt

    Matt Guest

    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");
    Matt, Sep 2, 2004
    #1
    1. Advertising

  2. Matt

    kaeli Guest

    In article <>,
    enlightened us with...
    > 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

    --
    --
    ~kaeli~
    If a book about failures doesn't sell, is it a success?
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Sep 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,527
  2. John Hann
    Replies:
    0
    Views:
    6,047
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    70,773
  4. Matt
    Replies:
    9
    Views:
    529
    kaeli
    Aug 23, 2004
  5. Tim
    Replies:
    1
    Views:
    283
    Grant Wagner
    Jan 18, 2005
Loading...

Share This Page