http://bytes.com/topic/javascript/answers/430012-body-onresize-vs-window-onresizeTony wrote:
> If I want to call a function (call it doResize) when the browser
> window is resized, is it better to put that in the body tag:
>
> <body onresize="doResize()">
>
> Or is it better to put the call in a script tag in the <head>:
>
> <script type="text/javascript">
> window.onresize = doResize;
> </script>
>
> Or, is there no practical difference between the two?
There is no `onresize' attribute for the `body' element in Valid HTML:
<URL:http://validator.w3.org/>
`onresize' is a proprietary event handler of the proprietary host object
`window' refers to.
The latter will either work, break on runtime or have no effect at all,
while the former will break in an SGML parser, and may work or have no
effect at all.
<URL:http://www.pointedears.de/scripts/test/whatami>
PointedEars
Is there an sane way to detect an window resize using javascript ?