javascript - 'event' equivalent in firefox -
i using following code , works fine in chrome.
function daybind(xyzvalue) { if(event.type == 'click') alert('mouse clicked') }
note there no 'event' variable passed function still available me in case of chrome. when use firefox 'event' undefined. tried using following workarounds:
var e=arguments[0] || event;
also:
var e=window.event || event;
but none of them worked me. there 'event' equivalent in firefox?
because ie , chrome put event in global object window
, can it. in firefox, need let first parameter event.
function daybind(event, xyzvalue) { var e=event || window.event; if(event.type == 'click') alert('mouse clicked') }
Comments
Post a Comment