body onresize vs window.onresize



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?

.


Quantcast