title: Generating unobtrusive JS
body: <p>I have read quite a bit about unobtrusive JS and how to generate it and all that jazz...</p>
  
  <p>My problem is this: I have a website that heavily relies on <code>mod_rewrite</code>, so essentially all the pages requests are sent to <code>index.php</code> that generates the main structure of the page and then includes the appropriate page. Now, there are different sections in the site and each section uses different Javascript functions (e.g. for different AJAX requests).</p>
  
  <p>Now, if I just were to attach a function to the <code>onload</code> of the page obviously the thing would not work, as I do not have to initialise the same things for each page... so what is the best way to handle this situation?</p>
  
  <p>I hope the situation is clear, I'll be happy to clarify if needed</p>