Yes, you can do that - see the
pjx_nobuild.pl example in the CGI::Ajax sources for how to do that (note that the line $html .= $pjx; in the example calls show_javascript, due to the overloading done in
CGI::Ajax).
Comment on Re^5: CGI::Ajax + Template::Toolkit Question