2 <script type=
"text/javascript">
4 function context_event(event
)
10 var swallow
= document
.getElementById("swallow_context").checked
;
13 "EVENT PROPERTIES<br>" +
14 "cancelable = "+event
.cancelable
+"<br>" +
15 "ctrlKey = "+event
.ctrlKey
+"<br>" +
16 "metaKey = "+event
.metaKey
+"<br>" +
17 "shiftKey = "+event
.shiftKey
+"<br>" +
19 "TEST PROPERTIES<br>" +
20 "prevent default = "+swallow
+"<br>" +
21 "event time = "+new Date()+"<br>" +
23 document
.getElementById("event_info").innerHTML
=str
;
27 if ((typeof event
.cancelBubble
) != "undefined")
28 event
.cancelBubble
=true;
30 if ((typeof event
.preventDefault
) != "undefined")
31 event
.preventDefault();
33 if ((typeof event
.returnValue
) != "undefined")
34 event
.returnValue
= false;
36 if ((typeof event
.stopPropagation
) != "undefined")
37 event
.stopPropagation();
47 <body oncontextmenu=
"return context_event(event)">
48 <div>To activate context menu, right-click or ctrl-click anywhere on the page.
</div>
50 <div><input type=
"checkbox" value=
"1" name=
"swallow_context" id=
"swallow_context"> Prevent default context menu
</div>
52 <tt id=
"event_info" style='background-color:#eeeeee'
>
53 -- No event captured --