$ 0 0 function getEvent() { if (window.event) return window.event; else return getEvent.caller.arguments[0]; } function showMessage(){ var e = getEvent(); // you can use this e object }