Results 1 to 6 of 6
  1. #1

    just a quick quistion?

    How come there isnt some snippet or code to stop right click around here ?
    i found a couple ive used in html .


    <body oncontextmenu="return false;">




    HTML Code:
    <script language="JavaScript">
    <!--
    /*
    No rightclick script v.2.5
    (c) 1998 barts1000
    barts1000@aol.com
    Don't delete this header!
    */
    
    var message="Sorry, that function is disabled.\nThis Page Copyrighted and\nImages and Text protected!\nALL RIGHTS RESERVED"; 
    
    // Don't edit below!
    
    function click(e) {
    if (document.all) {
    if (event.button == 2) {
    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>

  2. #2
    Because it doesn't stop people from being able to get the text + images .... so its a waste of code. You simply press f12 (on chrome) for example and its all there for that taking.

    The same reason why you cannot hide you're page source, although there is a way to do it, its a waste of time people can still grab it with push of a single button on the keyboard.

  3. #3

  4. #4
    Also you can always make a screen capture and then copy the image you want without even saying everybody can as well disable javascript and be able again to right click. Sorry but there is no way to protect you here.
    - Make Web Games Administrator
    - Creator of NWE
    - Owner of Nowhere Else and beyond
    - Mad developer

  5. #5
    There are instances where one would want to unhook a "right-click" event on web pages.
    They may not be for the reasons you would use it for, but I'll give an example where it would be beneficial to stop right clicking:

    You are running an emulated(no hardware requiring) application that attempts to have the UI(User Interface) match very closely to the real operating system.
    This could be because of any reason, but mainly I would think if you ran an SaaS(Software as a Service) application with a custom client(web browser).
    Now, right-clicking normally brings up an context menu with commonly used functions to a user's disposal.
    These could potentially be appended to or replaced entirely, so it does something like create a CRUD(Create Read Update Delete) menu specific to the web site.
    Other uses would be for uses in BB(browser based) Games, such as an FPS where right-click would be to dodge an attack or reload a weapon.

    Although context menu's aren't supported(except Opera) at this time, there is some discussion going on about it.
    Please see the following link for the proposed ideas: https://www.w3.org/Bugs/Public/show_bug.cgi?id=13608
    PHP is my wife, but JavaScript is my mistress.
    I only troll here if I have nothing better to do.

    ezRPG (latest) | ezRPG Rework (latest)

Similar Threads

  1. Quick help
    By rowbvp in forum General Discussion
    Replies: 6
    Last Post: 02-25-2011, 07:44 PM
  2. Quick please and thanks ;)
    By illusions in forum General Discussion
    Replies: 1
    Last Post: 10-29-2008, 05:08 PM
  3. A quick hello and a quick question :)
    By tasnet in forum General Discussion
    Replies: 3
    Last Post: 06-24-2008, 05:15 PM
  4. Quick help please
    By shrek1609 in forum PHP
    Replies: 17
    Last Post: 03-17-2008, 08:50 PM

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
  •