Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser support for stopImmediatePropagation?

IE support for stopPropagation() is lacking, and requires workarounds, but I can't tell if the same thing is true for stopImmediatePropagation()- is it safe for all browsers, or does it requires its own set of workarounds?

like image 323
Yarin Avatar asked Jun 05 '12 14:06

Yarin


People also ask

How do you use stopImmediatePropagation?

stopImmediatePropagation() The stopImmediatePropagation() method of the Event interface prevents other listeners of the same event from being called. If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.

What is stop immediate propagation?

stopImmediatePropagation() method stops the rest of the event handlers from being executed. This method also stops the event from bubbling up the DOM tree.


2 Answers

I was wondering for the browser support of JavaScript's event.stopImmediatePropagation as well, so I decided to test it by checking whether the following method exists:

Event.prototype.stopImmediatePropagation

It's supported on the following desktop browsers:

  • Internet Explorer 9+
  • Firefox 10+
  • Chrome 6+
  • Safari 5.0+
  • Opera 15+ (Presto doesn't support stopImmediatePropagation)
like image 81
Rob W Avatar answered Sep 17 '22 13:09

Rob W


The stopPropagation mentioned on the other answer is related to the method natively available on browser for the event object , while the stopPropagation() method of jQuery works fine in all browser (since it's a wrapper for the same task, taking into account the browser capabilities in which this method is run)

like image 24
Fabrizio Calderan Avatar answered Sep 17 '22 13:09

Fabrizio Calderan