Jump to content

Recommended Posts

 

<script language="javascript">

 

function click() {

 

if (event.button==2) {

 

alert('© 2003-2013 All rights reserved')

 

}

 

}

 

document.onmousedown=click

 

 

</script>

 script works just fine, can someone make it to be quiet no left click. I don't want that message. i can't script myself thanks for your help!

Edited by 325252525252
Link to comment
https://forums.phpfreaks.com/topic/280041-left-mouse-click-disable/
Share on other sites

No left click on the whole document?  Then you couldn't click links or anything.  You would have to have a single page site, or make exceptions for everything you want to click.

 

I don't see the point of blocking a left click though.

return false
Now, as for your whole idea: Anti-right-click scripts are nothing more than an annoyance and won't stop anyone from taking your images/source if they to. The only thing such a script will do is annoy the hell out of your visitors by preventing them from using their context menu for legit purposes such as opening a link in a new tab/window.

FULL SCRIPT IF ANYONE ELSE NEEDS IT:) WORKS PERFECT

Just a note.  The all caps and mix of big/small letters is irritating to people who have troubles reading.

 

You should really also listen to kricken.  Disabling right-click to protect your source is useless.  It doesn't even stop most people who don't understand well how things work, since in just about every popular browser, it's an option in the menu.  For people who do, JS ain't going to do anything anyway, as if we were to want to scrape or anything like that, it's not even executed.

 

I use right-clicks all the time for copying links and whatnot.  Opening links in a new tab I do with a middle-click, but you're also blocking people who do right-click to copy and paste, and many other legit reasons.  Blocking right-clicks should stay in the past, because there's no good use for it any more.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.