title: JavaScript: why does onbeforeunload fire twice on this page and how to prevent it?
body: <p>On this url <a href="http://www.yellowpages.ca/search/si/1/doctor/Seattle,%20WA" rel="nofollow">http://www.yellowpages.ca/search/si/1/doctor/Seattle,%20WA</a>, I open up console and copy paste </p>
  
  <pre><code>window.onbeforeunload = function (e) { return "Are you sure?"; }; 
  </code></pre>
  
  <p>and click on 'The Myo Clinic' and it ends up warning me twice. Any reasons to why?</p>
  
  <p>When I click anywhere else but the link, it will warn me only once.</p>
  
  <p>Why is this firing twice and how can I force it to fire only once?</p>