title: How to load javascript function in window.onload after some delay
body: <p>I have couple of functions that should be triggered after some delay in onload event. It works fine in chrome but not in Firefox.</p>
  
  <pre><code>function foo() {
      // javascript code
  }
  
  window.onload = setTimeout(foo, delay);
  
  function bar() {
      // javascript code
  }
  
  window.onload = setTimeout(bar, delay);
  </code></pre>
  
  <p>If I remove the delay, 'bar' gets invoked in Firefox and 'foo' and 'bar' get invoked in chrome. What could be the issue here?</p>