DOM对象event仅在事件发生的期间内存在。因此下面这种写法是错误的:

<a href="javascript:alert(window.event.x)">

而应当写成

<a href="#" onclick="alert(window.event.x); return false">