event is undefined for firefox browser on calling oncontextmenu
问题 I am displaying context menu on right-clicking a button in a page. The code used for displaying context menu is window.addEventListener('contextmenu',function (e){e.preventDefault();},false);} When I am right clicking the button, the context menu method called is displaycontextmenu(obj,event) { console.log("Context"); console.log(event); // Displaying context menu } The code executes fine in IE browser, even in chrome I can see in console that " Context " and event is printed. But in firefox