Results 1 to 4 of 4

Thread: Disable right click on picture or blog skin

  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation Disable right click on picture or blog skin

    1) Script Title: http://www.dynamicdrive.com/dynamicindex9/noright.htm

    2) Script URL (on DD): <script type="text/javascript">
    <!--

    /*
    Disable right mouse click Script (By Crash @ http://walk.to/crash)
    Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive
    For full source code to this script and 100's more, visit
    http://dynamicdrive.com
    */

    var message="Function 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.onmousedown=click;
    // -->
    </script>

    3) Describe problem: TY to Djr33 i can finally pose alot of codes But ... it does still does not work
    Last edited by lolfoollor; 02-27-2011 at 02:15 PM.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    this is javascript, not xml (or html, etc.).
    it will not validate as XML (etc.), and shouldn't be expected to.

    if you need your page to pass validation, place the script in an external file instead of inline in the document.

  3. The Following User Says Thank You to traq For This Useful Post:

    lolfoollor (02-27-2011)

  4. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Also, replace this:
    <script language=JavaScript>
    With the current standard:
    <script type="text/javascript">
    (Adding the src="path/to/file.js" will work for either, as traq suggested.)


    I guess that is a bug in the original script. Additionally, it doesn't do anything in Firefox 3 for OSX.

    In general, it is highly discouraged to attempt to modify browser behavior because it is not secure (hackers and others who are intentionally stealing or otherwise hurting your site can get around it) and it will usually cause problems for others.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. The Following User Says Thank You to djr33 For This Useful Post:

    lolfoollor (02-27-2011)

  6. #4
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ty guys

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •