IE9 is still in Beta, but all the same, here is a question:
Using prototype.js 1.6.1, proper form for adding a click event to a link, and override the default link behavior, would be:
mylink.observe('click', function(e){
doSomething();
e.stop();
});
While this works perfectly in every other browser that I tried, IE9 is a unique case. The default event behavior fires and my link takes me to the linked location. It seems that stop()
isn't doing its job in IE9.
The following code works perfectly in IE9:
mylink.onclick = function(){
doSomething();
return false;
}
Any idea what I could do to fix the prototype methodology for use in IE9?
prototype.js versions less than 1.7 does browser-sniffing to apply cross-browser compatible fixes.
prototype.js overwrites the native methods with it's implementation, which fails in IE 9; even-though it has support for DOM Level 2 Events.
The newer version of prototype.js doesn't have this issue as it does 'feature detection' rather than 'browser-sniffing'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With