How the Heck do I remove this script!

Discussion in 'JavaScript' started by classifiedsrealtor, Feb 13, 2007.

  1. #1
    Can someone please tell me how I can either delete this script from my site or modify it so that I can allow the site users to cut and paste on my site. The script below is embedded in a few of the pages in my site and disables anyone from right clicking and copying my site. It is a real pain for anyone who is trying to paste their listings and info into my site.

    If I delete the script or try and modify it then any other .PHP that is parsed on my site goes bananas with error messages like this one:

    warning:[function.main] failed to open stream. no such file or in directory/home.php on line 43

    This is the script in question:

    <SCRIPT LANGUAGE="JavaScript1.1">
    <!-- Begin
    function right(e) {
    if (navigator.appName == 'Netscape' &&
    (e.which == 3 || e.which == 2))
    return false;
    else if (navigator.appName == 'Microsoft Internet Explorer' &&
    (event.button == 2 || event.button == 3)) {
    alert("Sorry Pal, Permission Disallowed !");
    return false;
    }
    return true;
    }
    document.onmousedown=right;
    document.onmouseup=right;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (document.layers) window.captureEvents(Event.MOUSEUP);
    window.onmousedown=right;
    window.onmouseup=right;
    // End -->
    </script>


    Thank you for your assistance..
     
    classifiedsrealtor, Feb 13, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Try replacing the line just below "Begin"
    
    function right(e) {
    
    Code (markup):
    with this two lines:
    
    function right(e) { return true; }
    function oldright(e) {
    
    Code (markup):
     
    ajsa52, Feb 13, 2007 IP
  3. classifiedsrealtor

    classifiedsrealtor Guest

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ajsa52- Thank you for the suggestion but it didn't work.

    Why is it I can delete any other java script from the code in my site except for the one in question? This is really odd and frustrating.:confused:
     
    classifiedsrealtor, Feb 13, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    If your problem is with modifying a PHP script, maybe you should start a new thread on PHP forum: http://forums.digitalpoint.com/forumdisplay.php?f=37.

    But maybe it's a file attributes problem. Try setting 777 attributes on PHP file with that javascript code.
    Then you should be able to modify that file.
     
    ajsa52, Feb 13, 2007 IP
  5. classifiedsrealtor

    classifiedsrealtor Guest

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5



    That is definitely a javascript I am talking about but yes when I modify or delete the script it disrupts the other PHP files from parsing on the page the script is on.

    I figured the best forum to talk about javascript would be in the java forum but maybe I am breaking a PHP loop so yes possibly a question for someone who knows about embedding java in PHP.;)

    Anyways, if anyone has any ideas on how to remove this script from my site code please do tell..thanks
     
    classifiedsrealtor, Feb 13, 2007 IP