javascript - Firefox gives error for an event object -


this code works great on chrome, wont work on ie or firefox.

$('.modal').on("click", ".action", function() {     if($(event.target).hasclass('added')) {         if($(event.target).hasclass('remove_vehicle')) {            //code         } 

i error on firefox console:

referenceerror: event not defined [break on error]     if($(event.target).hasclass('added')) { 

what wrong here? both event.trigger , hasclass supposed work on firefox.

try -

$('.modal').on("click", ".action", function(event) { // see difference in line      if($(event.target).hasclass('added')) {         if($(event.target).hasclass('remove_vehicle')) {            //code         } 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -