From the course: JavaScript: Events

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using events with old browsers

Using events with old browsers - JavaScript Tutorial

From the course: JavaScript: Events

Start my 1-month free trial

Using events with old browsers

A little support for really old browser has becoming less important as the web platform matures. It's still a good idea to review some of the options we have, when trying to make things with legacy browsers. This is a special problem with the event model. Because of differences in how older browsers handle events. The main problem happens in IE8 and earlier. These browsers have a different model for handling event. Instead of using the addEventListener method that we're using in modern browsers, they use a similar method called Attach Event. And this is what it looks like. Now, notice there's a couple of important differences here. First, we will use addEventListener we pass the clickEvent. When we use attachEvent, we're passing an on clickEvent. So it's a slightly different name. The other thing is, that attachEvent doesn't use the event propagation parameter. We'll talk more about that in the next movie but you can see that it's not being passed right here, in IE8. So if you wanted…

Contents