hey there this is the code just copy and paste and it will do the same disable right click
| Code: |
<script language=JavaScript>
<!--
var message="hey its been disabled :)";
function click(z) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (z.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>
|
This will only work if javascript is enabled. Disable right click will most likely irritate many visitors.
| Peterssidan wrote: |
| This will only work if javascript is enabled. Disable right click will most likely irritate many visitors. |
Yep, it may be your site, but it is the users browser.
I don't understand why somebody would want to block the context menu...
the source can allways be viewed by using the menu
| Marcuzzo wrote: |
| Peterssidan wrote: | | This will only work if javascript is enabled. Disable right click will most likely irritate many visitors. |
Yep, it may be your site, but it is the users browser.
I don't understand why somebody would want to block the context menu...
the source can allways be viewed by using the menu |
Yeah it's a good script if you want to irritate people or keep ignorant people from....copying and pasting I guess? I don't see the point. Might as well throw in some constant alert boxes and pop-ups, that will keep even more people away.
I hate sites that do that, just to keep their images from being copied. But someone who is trying to do that will know to turn of JavaScript. the only people it hurts are the users who aren't doing anything "wrong".
Code practices like that are stupid and irritating.
| Star Wars Fanatic wrote: |
I hate sites that do that, just to keep their images from being copied. But someone who is trying to do that will know to turn of JavaScript. the only people it hurts are the users who aren't doing anything "wrong".
Code practices like that are stupid and irritating. |
Yes, i think that code is not necessary. i hate the website uses that code, if want to protect your code from visistor, you can encode them.
| thedinh wrote: |
| Yes, i think that code is not necessary. i hate the website uses that code, if want to protect your code from visistor, you can encode them. |
that will only slow people down of reading the source, you can't protect your source,
if you want to protect stuff you would use server-sided
| Marcuzzo wrote: |
that will only slow people down of reading the source, you can't protect your source,
if you want to protect stuff you would use server-sided |
Don't give him any ideas, he might try rendering sites server-side.
| Hogwarts wrote: |
| Marcuzzo wrote: | that will only slow people down of reading the source, you can't protect your source,
if you want to protect stuff you would use server-sided | Don't give him any ideas, he might try rendering sites server-side. |
Yeah you could just render it as Flash server side and make the site flicker continuously so it's not even easy to screen capture an image....</sarcasm>
Sorry, I feel kind of mean attacking this guy...but, disable right click...really?
It is a pretty annoying script. Especially when you just want to copy some text to show someone something.
If they are so worried about not getting their images stolen, just put a watermark over everything. Sure it doesn't keep everyone away, but if someone is just looking to steal an image, they will probably search for one that isn't watermarked.
I haven't seen it used in quite a long time though.
all this type of script does is block the context menu, it will not keep people from stealing your code. If you can view the source...everything on the page can be stolen.
If you view it with your browser, it's on your computer (with the exception of scripts), all you need to do is find it.
I know a site that had it's content copied by newspapers, without quoting a source. The webmaster wasn't able to sue them because the newspaper said they didn't know they weren't allowed to copy. After this her lawyer said that making a popup when the user right-clicked would prevent the same from happening again.
I'm not sure if she just had a bad lawyer (I think she did), but this might be the reason for other websites to do the same.
But exactly, if you protect form opening right click. the vistor can still use other method to view and the copy the content on the page.
For example: the can view page source.
It's nearly as annoying as those sites where you get a popup box saying "OMG PLEASE DON'T LEAVE" when you exit or navigate away and then have to kill the process.
I don't get it why you want to block the contextmenu.
If I see a page that does that, I will definitely look at the source and never visit the site again.
if you don't wan't people to use your stuff... put a legal notice in it, let them copy your text and images, if you find out, you send them a mail asking them to remove it, if they don't remove it you go to court
Okay okay okay!
But for those who want to do it, here's the script anyway.
This is almost as bad as infinite windows, or popups that won't let you leave a page. Some things Javascript allows for convenience (keeping people from accidentally leaving an active page, introducing a new window of data, etc) but end up getting misused.
Also echoing others in saying, you can't stop people getting your content. Which would be besides the point, since, aren't you meaning to share it by posting it?
| Hogwarts wrote: |
| Marcuzzo wrote: | that will only slow people down of reading the source, you can't protect your source,
if you want to protect stuff you would use server-sided | Don't give him any ideas, he might try rendering sites server-side. |
LOL 
Disable right click was web 1.0
There's serveral ways annoying people who tries to view your source code such as AJAX, flash wrapper, code packer... etc. but no way to prevent them.. SURRENDER YOUR CODE (if they are in fact yours...) 