IE8でもEventオブジェクトのとり方は一緒

Eventオブジェクトのとり方

とりあえず現行通りに、window.eventオブジェクトでいけるらしい。ここは、IE路線を貫くのね…。

検証コード

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <script type="text/javascript">
        document.onkeydown = function(e)
        {
             alert(e); // undefined
             alert(window.event); // [object Event]
        };
    </script>
</head>
<body>
</body>
</html>