How to dynamically include all scripts in a page using body onload event
<p>I am trying to include a page (a.xhtml) using <code>&lt;ui:include&gt;</code> inside <code>&lt;rich:dataTable/&gt;</code>. The included page contains a script to load a image. Based on the number
of iterations script will be included with different function names. I want
to call all the javascript function in a page on body onload event. How to do this?</p>

<p>My code will look like this </p>

<p><strong>a.xhtml</strong></p>

<pre><code> &lt;f:subview&gt;
   &lt;canvas id="#{canvasId}"/&gt;   
   &lt;script&gt;
     function #{fnName}() {
       ...
     }
   &lt;/script&gt;
 &lt;/f:sunView&gt;
</code></pre>

<p><strong>b.xhtml</strong></p>

<pre><code>&lt;rich:panel&gt;
  &lt;html&gt;
    &lt;body&gt;
      &lt;tich:dataTable var="item" value=#{items}" rowKeyVar="num"&gt;
        &lt;rich:column&gt;
          &lt;ui:include src="a.xhtml"
            &lt;ui:param name="canvasId" value="img_#{num}"/&gt;
            &lt;ui:param name="fnName" value="fn_#{num}"/&gt;
          &lt;/ui:include&gt;
        &lt;/rich:column&gt;
      &lt;rich:dataTable&gt;
    &lt;/body&gt;
  &lt;/html&gt;
&lt;/rich:panel&gt;
</code></pre>
