title: How to I detect if an onscroll event was programmatically generated?
body: <p>I'd like to have a handler fire whenever the user scrolls, but I don't want it to happen when the browser scrolls on behalf of the user. For example, the document below scrolls itself as part of onload. This fires my onscroll handler, but I don't want it to. Even if I remove the onload, there's still a problem: if the user scrolls and then reloads the page, the handler fires upon reload. Again, I don't want that.</p>
  
  <p>Can the handler detect who caused it to be fired?</p>
  
  <pre><code>&lt;html&gt;
   &lt;body onscroll="alert('scroll detected')"
         onload="window.scrollBy(0, document.height)"&gt;
    aaa&lt;br/&gt;bbb&lt;br/&gt;ccc&lt;br/&gt;ddd&lt;br/&gt;eee&lt;br/&gt;fff&lt;br/&gt;ggg&lt;br/&gt;hhh&lt;br/&gt;iii&lt;br/&gt;
    jjj&lt;br/&gt;kkk&lt;br/&gt;lll&lt;br/&gt;mmm&lt;br/&gt;nnn&lt;br/&gt;ooo&lt;br/&gt;ppp&lt;br/&gt;qqq&lt;br/&gt;rrr&lt;br/&gt;
    sss&lt;br/&gt;ttt&lt;br/&gt;uuu&lt;br/&gt;vvv&lt;br/&gt;www&lt;br/&gt;xxx&lt;br/&gt;yyy&lt;br/&gt;zzz
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>