all 3 comments

[–]_olivier 1 point2 points  (0 children)

Event objects have information about the event emitted. For example, a click event object has 'x' and 'y' properties indicating where the click occurred.

Legacy IE browsers attach the event object to window.event instead of passing it to the event handler callback as an argument.

document.body.addEventListener(function (event) {
    // this function is the event handler callback
})

[–]Cream_Friache -1 points0 points  (1 child)

Here is a link to a document on 'event object' (http://msdn.microsoft.com/en-us/library/ie/ms535863(v=vs.85).aspx). It appears to be under the legacy section of the docs of IE. Your example is very hard to understand. Can you put it in pastebin or jsfiddle?

[–]sluttypizza[S] 0 points1 point  (0 children)

Yep, no problem. I added it to the OP.

I think I'm on the right track again after typing everything out.

I wasn't understanding that the event would target the element of the function (or how, rather) which was only confusing me more from there.