I am trying to create a custom right-click menu in javascript, and I can't get the coordinates of the mouse when using
oncontextmenu in IE7. I have it working fine in firefox, but in IE the
window.event comes back as null.
Code:
checkbox.oncontextmenu = function(event) {
if (event == null)
event = window.event;
alert("event: "+event);
alert("window.event: "+window.event);
/* Handle right-click */
};
I understand that IE does not pass along the event, but is there any reason why both of my alerts (specifically
window.event) print null?