html to prevent right click?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manutdvn
    Senior Member
    • Jul 2005
    • 378
    • 3.5.x

    html to prevent right click?

    Do you know how to prevent right click just only header section? I heard that I have to put html into somewhere. Can somebody help me to solve this?
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Such code will apply to the whole frame it is in.

    HTML Code:
    <!-- Copyright &#169;2005 Kier Darby and www.thenewdeli.com -->
    function donothing()
    {
    return false;
    }
    document.oncontextmenu = donothing;
    <!-- bypass this by turning off javascript! -->

    Comment

    • manutdvn
      Senior Member
      • Jul 2005
      • 378
      • 3.5.x

      #3
      Where can I put it in? Can you tell me in detail, please?

      Comment

      • Floris
        Senior Member
        • Dec 2001
        • 37767

        #4
        In a .js file, and then call that somewhere in your .html file.

        Comment

        • ajaspers
          Senior Member
          • Sep 2003
          • 132
          • 3.8.x

          #5
          This code can be easily disabled by typing "javascript:void(document.oncontextmenu=function(){return true});" in the address bar of your browser. It'll only aggravate your users, without preventing anyone determined from stealing your content.
          Last edited by ajaspers; Sun 7 Aug '05, 10:25am.

          Comment

          • diades
            Senior Member
            • Jul 2002
            • 291
            • 3.5.x

            #6
            The guys on our forums had some fun with no right click and hiding source when they got bored once, the lengths they went to:
            Later
            Keith

            Webxpertz Community for Webmasters & Developers

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎