How to disable right-click on web pages with dreamweaver

Written by brandynbuchanan
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to disable right-click on web pages with dreamweaver
Digital copying can quickly become an uncontrollable monster. (Frankenstein 2 image by chrisharvey from Fotolia.com)

Adobe Dreamweaver is a popular Web-development tool that allows users to design, manage and maintain their web site without the need for occasionally tedious hand-coding. Dreamweaver's users can create intricate, complex sites with a lot of content, so it's only natural that some webmasters will want to protect their material from competitors and snoops. You can deter potential thieves by disabling the right-click feature on all Web pages produced in Dreamweaver.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Use a JavaScript code. In Code view, open the page you're trying to protect and paste the following code inside your <HEAD> tag:

    &lt;script language="javascript"&gt;
    
    document.onmousedown=disableclick;
    
    status="Right Click Has Been Disabled!";
    
    Function disableclick(e)
    
    {
    
      if(event.button==2)
    
       {
    
         alert(status);
    
         return false;
    
       }
    
    }
    
    &lt;/script&gt;
    

    Now when someone tries to right-click your site, they'll get a customised error message.

  2. 2

    Call an external function. Copy the above code and paste it into a text file, saving it in your site's root directory as "protect.js." One of Dreamweaver's most powerful features is a search-and-replace function that will replace text anywhere on your web site. Press Ctrl+F with your site open and select "Entire Current Local Site." Paste your current <HEAD> tag in both the "Find" and "Replace" boxes and then add the following line of code to the "Replace" box:

    <SCRIPT language="JavaScript" SRC="http://www.yourwebsite.com/protect.js"></SCRIPT>

    Click "Replace All," and your entire site will be protected.

  3. 3

    Use a body script to disable the context menu. This can't be used externally like the header script, but it's lightweight and disables Shift+F10 context menus. Replace the body tag with this line:

    <body oncontextmenu="return false;">

Tips and warnings

  • Find other ways to protect your content. Modern browsers, such as Firefox, allow users to disable click-blocking, and Opera does so automatically. Try watermarking, digital tracking and flash files to save your content more effectively.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.