3
There is an implementation crossbrowser for the methods jQuery.Event.preventDefault(), jQuery.Event.stopPropagation() and jQuery.Event.stopImmediatePropagation() that does not require jQuery?
I have a very specific resource that wouldn’t justify relying on jQuery, even if by Cdns, which I don’t trust.
By the source code of jQuery.Event it is possible to see that the three methods are prototyped based on their availability in the object Event.
But for the "unofficial documentation" on MDN, Event.stopPropagation() has browser availability restriction (Internet Explorer 9).
In that stack of SOEN has an implementation to which I felt sufficiently compatible for the jQuery.preventDefault(), but and the others?
The intention is not only know which inventions "microsoftianas" are equivalent to each method of the Event and yes have a definitive answer about possible fallbacks (even by enriching the KB of the site) and when or in which situations *fallbacks** should or should need to be applied.
Although I don’t like Javascript I came to this conclusion but if only Event.stopPropagation() needs a differentiated implementation to also consider the cancelBubble, because the SOEN link I quoted is made the same kind of fallback to the Event.preventDefault(), returning false if this is not available in the object?
– Bruno Augusto
According to the microsoft documentation, the
event.preventDefault()
is similar toevent.returnValue
Internet Explorer 8 and earlier.– Guilherme Portela
I don’t think you understand the point of the question. It was good that you were willing to bring these two information, although the second was already implicit in the SOEN’s reply.
– Bruno Augusto