Home > Javascript > Prototype 1.6, Event.stop and IE9 – Quick patch

Prototype 1.6, Event.stop and IE9 – Quick patch

November 30th, 2011

For those of you using Prototype 1.6 (or Magento prior 1.6), you might wonder why event.stop() or Event.stop(event) doesn’t work in Internet Explorer 9. Here’s a quick explanation:

IE 9 makes major changes to the event system. We had to rewrite the
event code in 1.7 to support it. You can either (a) upgrade to 1.7;
(b) force your site into compatibility mode [1].

So it’s been fixed in 1.7, but what if I can’t upgrade to 1.7 and don’t want to render my website in compatibility mode? Well, after a couple of hours trying to sort this out, here’s quick (and dirty) patch for Prototype 1.6.0.3. Prototype 1.6.0.3 Event.stop IE9 fix (1336 downloads)

Also, for further reading, here are two external links that you might find useful for this issue.

Note/Disclaimer: This has only been tested on Prototype 1.6.0.3. Use it at your own risk.

  1. Cristi
    | #1

    not sure what the problem is on IE8, but the patch was for stopping events on IE9

  2. Igor
    | #2

    Did not work for me as well, but as mentioned here (http://stackoverflow.com/questions/1000597/event-preventdefault-function-not-working-in-ie) in comments by jmort253, event must be a global for IE8, did that for me in IE9 as well.

  3. Cristi
    | #3

    Strange, as it’s the version I use on a production server and work perfectly fine. At least when it comes to Event.stop which wasn’t working on IE9. Can you detail a little bit?

  4. Ed
    | #4

    This does not work at all for me.

  1. No trackbacks yet.