Allow me to clairify, I&#39;m using CGI::Application.&nbsp; It has you return your output at the end of each &quot;function&quot; and it prints it for you.<br>I guess I&#39;m wondering if I should be using the header_add function to apply the new javascript before CGI::Application prints.
<br><br>-ASC<br><br><div><span class="gmail_quote">On 3/2/07, <b class="gmail_sendername">Michael G Schwern</b> &lt;<a href="mailto:schwern@pobox.com">schwern@pobox.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Andrew Clapp wrote:<br>&gt; I hope there is a good way to do this.<br>&gt;<br>&gt; I have a very nice function in my CGI app that makes a nicely formatted<br>&gt; table out of a few arguments, the title, an sql query, etc.
<br>&gt; If I want to make it sortable using dojo&#39;s javascript library, this<br>&gt; requires me to place some javascript (that specifically references the<br>&gt; table) in the header of the html, but typically, I&#39;ve already printed
<br>&gt; the header by the time I want to generate the table.<br>&gt;<br>&gt; How is this done correctly?<br><br>Instead of printing HTML fragments immediately, use a template and pass it<br>in all the information it needs to render the page.
<br></blockquote></div><br><br clear="all"><br>-- <br>&quot;Yes, could I please have half an order of magnitude and a side of PI?&quot;<br>