View Full Version : Disable right click and text selection blogger?

12-01-2008, 02:35 PM
Hi is there any way that i can do this? I am a noob in this, so please teach me how. I'll post my blog template if I have to. I'm using firefox btw.

Thanks in advance.

12-01-2008, 04:12 PM
<script type="text/javascript">
document.oncontextmenu = function () { alert('- All rights reserved -\nŠ2008 yourname'); return false; }
will popup an alert box on rightclick

12-02-2008, 03:52 AM
I wonder what you are trying to protect by disabling the right click. You can find lots of JS code that does this but believe me people can still do whatever they want with your content, images, etc even if you disable the right click.

You'll be able to find lots of questions regarding this here if you search more.

12-02-2008, 04:51 AM
Ditto what codeexploiter said.

I would add that scripts to disable common browser functions will never succeed in their intent because browsers have the last say in these matters, and as codeexploiter pointed out, even when such scripts work, their are other ways for the user to get what they want.

But, more importantly, such scripts add to the bandwidth of the page and may conflict with other code (javascript, or sometimes just plain HTML content) such that they then become basically just trouble.

If your concern is protecting your content, copyright law does that.