This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How to Disable Right Click in browser window using java script



this will help u
<HTML>
	<HEAD>
	
	<SCRIPT LANGUAGE="JavaScript">
	 function click(e) {
                  if (document.all) {
                    if (event.button==2||event.button==3) {
                      oncontextmenu='return false';

                    }
                  }

                  if (document.layers) {
                    if (e.which == 3) {
                      oncontextmenu='return false';
                    }
                  }
                }

                if (document.layers) {
                    document.captureEvents(Event.MOUSEDOWN);
                }
                document.onmousedown=click;          
                                
                function handleKeyDown() {
                    if (window.event.keyCode == 116) {     
                        event.keyCode=0;
                        event.returnValue=false;   
                    }
                }
                document.onkeydown = handleKeyDown;             
                 </SCRIPT>
	
	</HEAD >

	<BODY BGCOLOR="#E0E0E0" TEXT="#000080" oncontextmenu="return false"
ondragstart="return false" onselectstart="return false">
	U can not right click on this page
	</BODY>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]