-1

I have this code

\$Title.on('blur',function(){

            //on blur fire the event
            clearTimeout(typingTimer);
            if (\$Title.val()) {
              typingTimer = setTimeout(doneInput ,doneTypingInterval);
             \$eventId =  event.target.id;
              console.log(event.target.id);
            }

        });

When this event is fired a request is sent to DB, now i want if the request was successful i will display a message to the user, i have many DIV one the same page with different ID and different event say like on change event, Now i want to be able to know which particular Div return success so i used even.target.id which returns the ID as i desire, now when i test code it works as expected in chrome and in IE, but when i test on firefox ReferenceError: event id not define. $eventId is a global variable so i try to set the value to $eventId =""; to see if this can work but still it doesn't work, inicially i define it like this $eventId; any help on this, why this don't work on firefox. Thanks for any help

sam
  • 853
  • 3
  • 19
  • 50

1 Answers1

0

The problem is with firefox, In firefox, you have to receive event object in your event handler like \$Title.on('blur',function(event) this solves my problem

sam
  • 853
  • 3
  • 19
  • 50