38 users online (2 members and 36 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 1
  2. Replies: 4
  3. No right click    Forum: HTML Forum
    Replies: 3
  4. No right click!!!!!!!!!    Forum: Javascript Forum
    Replies: 7
  5. no right click    Forum: HTML Forum
    Replies: 7
  1. #1
    geek987's Avatar
    Man Utd Fans

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    156

    Question right click 4 link

    how can i make it so that when someone right clicks on my images or background , they get automatically sent to another web site?

  2. #2
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    just modified creatures code a bit...

    Code:
    <html>
    <head>
    
    <script language="Javascript1.2"> 
    var wrong = "http://www.yourwrongpage.com";
    function NoRightClick(b) { 
    if(((navigator.appName=="Microsoft Internet Explorer")&&(event.button > 1)) 
    ||((navigator.appName=="Netscape")&&(b.which > 1))){ 
    location.href=wrong
    return false; 
    } 
    } 
    document.onmousedown = NoRightClick; 
    --> 
    </script> 
    
    </head>
    <body>
    </body>
    </html>
    Really, if this is another try to protect your source code this would be worse than the "ouch!" that sometimes comes up when people have no-rightclick scripts.

  3. #3
    geek987's Avatar
    Man Utd Fans

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    156

    thx

    thx really much! but can u open dat page in another window?

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    just a simple modification:

    Code:
    <html>
    <head>
    
    <script language="Javascript1.2"> 
    function NoRightClick(b) {
    if(((navigator.appName=="Microsoft Internet Explorer")&&(event.button > 1)) 
    ||((navigator.appName=="Netscape")&&(b.which > 1))){ 
    window.open("wrong.html","def","height=300,width=300")
    return false; 
    } 
    }
    document.onmousedown = NoRightClick;
    --> 
    </script> 
    
    </head>
    <body>
    </body>
    </html>
    however, this does not work because they can keep right clicking and still get the right click menu to pop up. Really, I'd just give up the no right click thing. What is so valuable on ur page?



Tags for this Thread