title: Why window.addEventListener does not work?
body: <p>On the window.onload event, I would like a function to be called. 
  If I define it as given below, the function does not get called.</p>
  
  <pre><code>try {
      window.addEventListener("load", initialiseTable, false);
  } catch(e) {
      window.onload = initialiseTable;
  }
  
  var initialiseTable = function () {
      console.log("hello world!!");
  };
  </code></pre>
  
  <p>but if I change the function declaration to</p>
  
  <pre><code>function initialiseTable() {
      console.log("hello world!!");};
  </code></pre>
  
  <p>it works, any idea?</p>