Monday, June 21, 2010

HOW TO DISABLE "RIGHT CLICK" IN BLOG

Hadoih...MAK pening ni, ada orang tanya macam mana nak elakkan orang tekan "right click" pada mouse di blog dia... Mak pun tak tau, tapi bila Mak browse internet, terjumpa pulak cara-caranya...

Sebenarnya, tujuan widget nie dibuat adalah untuk elakkan orang lain senang-senang jer copy barang kat blog dia...hahahaha..Mak tak kisah, u all nak amik apa-apa kat blog nie, amik le...

SELAMAT MENCUBA!!!

You might have seen websites with no right clicking on their pages. This is just to minimize the risk of content copy. The right mouse button won’t work in their sites, basically used to select contents & copy or to save images. Blocking or disabling right click will make other things work normally, people can view and surf everything, all they can’t do is copying any text or image from your site. And now we can apply this blocking trick to disable right click in blogger/blogspot blogs.

To block people from copying text or image from your blogger/blogspot blogs, you need to disable right click. And in order to do this, you need to add a code to your blog. This code needs to be added in the page elements page as a new widget. Follow the below steps.

  1. Log into your blogger dashboard.
  2. Navigate to your blog’s Layout >> Page Elements page.
  3. Now add a new widget by navigating to Add a Gadget >> HTML / JavaScript
  4. Add the following code to HTML / JavaScript box.
  5. function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
    alert(message);
    return false;
    }
    }
    }

    if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
    }
    else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
    }

    document.oncontextmenu=new Function(“alert(message);return false”)

    // –>

  6. Save the widget and you are done.
Now no one can steal your contents as you have disabled right clicking on your blogger blog. But still I would like to advise you not to do this. It might affect innocent people from copying some necessary codes from your blog. You can deal with those people who steals your content in a legal way.

No comments: