RE: [xsl] How to Disable Right Click in browser window using javascript

Subject: RE: [xsl] How to Disable Right Click in browser window using javascript
From: "iva karr" <iva@xxxxxxxxxxxxx>
Date: Sun, 17 Mar 2002 11:52:21 -0800
Disabling the right click in IE 6 is easier, but if you are looking for a
cross-browser solution, try the js bellow.
Note: it's buggy in NS 6 - the right click is caught, but the right click
menu still shows up even though we returned false, there may be a way to
cancel the event bubble, but I haven't spent time looking into this.
----------------------------------------------
<script language=JavaScript>

 var message="foo";
 function click(e) {
 	if (document.all) {
 		if (event.button==2||event.button==3) {
 			alert(message);
 			return false;
		 }
 	}
 	 if
((document.layers)||(window.navigator.userAgent.toLowerCase().indexOf('gecko
') != -1)) {
 		if (e.which == 3) {
 			alert(message);
 			return false;
 		}
 	}
 }

 if
((document.layers)||(window.navigator.userAgent.toLowerCase().indexOf('gecko
') != -1)) {
 	document.captureEvents(Event.MOUSEDOWN);
 }
 document.onmousedown=click;

</script>
----------------------------------------------

Best,
Iva



-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
Sent: Sunday, March 17, 2002 11:14 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] How to Disable Right Click in browser window using
javascript


> i want to disable right click of mouse in browsser window
> how can this be done

This is a JavaScript question, not an XSLT question. Once you know what
HTML/JavaScript you want to generate, it should be easy to generate it using
XSLT.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx


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


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


Current Thread