Disabling right click menu using javascript Enhanced Version

This Tutorial Has Been Viewed 2,405 Times.

This is an enhanced version of how to disable right click menu from a webpage.

Simple just copy and paste this code


<script LANGUAGE="JavaScript">
var message="Sorry this function is disabled."
function clickIE4(){
if(event.button==2){
alert(message)
return false}}
function clickNS4(e){
if(document.layers||document.getElementById&&!document.all){
if(e.which==2||e.which==3){
alert(message)
return false}}}
function disableselect(e){
return false}
function reEnable(){
return true}
document.onselectstart=new Function("return false")
if(window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable}
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")
</script>

Enjoy!!!!!!!!!!!!!


VN:F [1.9.13_1145]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.13_1145]
Rating: +1 (from 1 vote)

Disabling right click menu using javascript Enhanced Version, 10.0 out of 10 based on 2 ratings

Incoming search terms:





You will also be interested in ,

2 Responses

  1. hai says:

    How to make this work for FF?

    VA:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.13_1145]
    Rating: 0 (from 0 votes)
  2. admin says:

    Hello,
    This will work fine both in IE and FF…please test it once..thanks….OR get back with your concerns…..

    VN:F [1.9.13_1145]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.13_1145]
    Rating: 0 (from 0 votes)

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in Css, Flash, JavaScripts, Others, scripts, Tools, Wordpress Tips (150 of 185 articles)