title: on ready state change multiple times
body: <p>I'm using this method to set a function for when the page is loaded.</p>
  
  <p>It works fine but I want to actually call various set of functions on different pages. The problem is each time I include this code overwrites the previous one so only one function is launched on page load.</p>
  
  <pre><code>document.onreadystatechange = function () {
    var state = document.readyState
    if (state == 'interactive') {
  
    } else if (state == 'complete') {
      myFunc();
    }
  
  }
  </code></pre>
  
  <p>So how would I add functions instead of creating a new one for onreadystatechange each time?</p>