where to place browser event (resize/scroll) detection call
<p>I'm trying to alert a message when the browser is resized or scrolled. I'm detecting the 2 events in the body </p>

<pre><code>&lt;body onResize="doDisp();" onScroll="doDisp();" &gt;
</code></pre>

<p>where <code>doDisp</code> is this inside the <code>&lt;script&gt;</code> tag</p>

<pre><code>&lt;script type="text/javascript"&gt;

  function doDisp(){
    alert("browser changing state");
  }

&lt;/script&gt;
</code></pre>

<p>but isn't it bad practice to have javascript in the body tag? Is there a <strong>cross-browser</strong> way to keep all the javascript inside the <code>&lt;script&gt;</code> tags?</p>
