title: Add Javascript to included JSF page?
body: <p>I got a <code>MainPage.xhtml</code> which includes a lot of other xhtmls like:</p>
  
  <pre><code>&lt;ui:include src="/pages/includes/included1.xhtml"
                      id="included1ID"/&gt;
  &lt;ui:include src="/pages/includes/included2.xhtml"
                      id="included2ID"/&gt;
  </code></pre>
  
  <p>... and so on. </p>
  
  <p>There is some logic behind it which included page will be loaded, works fine.
  I want to write some Javascript in the included pages which runs immediately as the page loads (for example in the <code>included1.xthml</code>).</p>
  
  <p>I tried adding this section right after the <code>&lt;ui:composition&gt;</code> tag:</p>
  
  <pre><code>&lt;h:head&gt;
      &lt;h:outputScript&gt;
            .
            .
          some JS
            .
            .
      &lt;/h:outputScript&gt;
  &lt;/h:head&gt;
  </code></pre>
  
  <p>It works fine if I use it in a NOT included page, but doesn't work on included ones.
  Is there any way to add my JS to those pages? </p>