Do events bubble up to window in IE?
问题 I'm binding a simple click event to the window object but the handler doesn't get called in IE8 (works on Chrome and FF): $(window).click(function (e) { alert('Hello there! I\'m in the window.click hanlder!'); }); Anyone why this is happening? 回答1: It seems that IE (testing IE8) doesn't bubble events to the window . Here's an example ( http://jsfiddle.net/SZXrn/8/ ): if (window.attachEvent) // IE { window.attachEvent('onclick', function () { alert("Yay window obj was clicked! IE"); });