Q:

ie8 onresize event, firing twice

in my html:
<body onresize="doSomething();">

I have this in my javascript:
function doSomething() {
    alert(1);
    // it doesn't actually have alert(1), but this is just for demonstration
}

When i resize the browser window ( by double clicking its title ), the event fires twice in IE8, thus messing up with the function.
Does anyone know why and how it can be avoided ?
thanks in advance!

A:

You will find, that if you "resize around" a browser window by randomly moving around the drag area in the lower right corner, the onresize event fires repeatedly.
The point is, that it is quite debateable, what constitutes a window resize. You will have to accept, that this is wildly different between browsers and OSes. 
Recipies to handle that include cancelling if set, then setting a timer (window.setTimeout) on the resize event and doing the real resize work when the timer fires.
If your onresize is not too expensive, you should just create it in a way, that is unconcerned by repeated calling.

