How much I dig into JavaScript, I find myself asking that much. For example we have window.onresize
event handler and if I say:
window.onresize
Instead of replacing such a catch-all handler, you should just add a DOM 2 listener like this:
window.addEventListener("resize", myResizeFunction);
or in more details:
if (window.addEventListener) { // most non-IE browsers and IE9
window.addEventListener("resize", myResizeFunction, false);
} else if (window.attachEvent) { // Internet Explorer 5 or above
window.attachEvent("onresize", myResizeFunction);
}