title: window onload and window onfocus
body: <pre><code>window.onload = function() {
  window.onfocus = alert('example');
  }
  </code></pre>
  
  <p>I've met this problem, anyone can help?
  I'm new at javascript and made this expecting to work properly, but it does not :)</p>
  
  <p>I want to alert the word "example" when the page is fully loaded and active, but don't want to alert the word "example" if the page is fully loaded but not active (<code>onblur</code>).
  And when user comes back (<code>onfocus</code>) then alert "example".</p>