[Catalyst] external javascript files

Tobias Kremer list at funkreich.de
Mon Mar 24 22:13:51 GMT 2008


On 24.03.2008, at 22:43, Jennifer Ahn wrote:
> i'm tyring to call my external javascript library under myapp/root/ 
> src/myjavascript.js in my tt2 file by placing this line at the top  
> of the tt2 file:
> <script language="Javascript" src="/myjavascript.js" type="text/ 
> javascript"></script>
> is this the right way to use an external javascript file in my  
> template file?

I'd put myjavascript.js in root/static/js or something like that and  
use uri_for to make the app relocatable:

<script type="text/javascript" src="[% Catalyst.uri_for('/static/js/ 
myjavascript.js') %]" />

--Tobias


--Tobias






More information about the Catalyst mailing list