Internet Explorer 5 still lives

Internet Explorer 5 still lives

There was a time where Chrome didn’t exist and IE was ruling the web world.

Back in this day, it was common for browsers to take liberty and implement some shortcuts.

For example, IE5 automatically defined a global event property that contained the event that was triggered so that when executing event callbacks, the user didn’t have to do anything and so the following code would work.

JavaScript

1

2

3

4

5

6

7

document.body.addEventListener('click',function(){

// works: window.event is globally defined the time the callbacks is executed

console.log(event);

});

// undefined: event is only defined during the execution of the event callback

console.log(event);

What you may not know is that this code still works in Chrome 63, some 18 years later!