You have a few alternatives:<br>
<br>
The first is simply to embed the code in the HTML page. Eg:<br>
<script language="Javascript"><br>
my code...<br>
</script><br>
<br>
This is the easiest, but can be wasteful on bandwidth if the code is long.<br>
<br>
<br>
Next option (which I think it the best): Create a directory in your template module directory and put the script there. Eg <br>
/system/modules/com.myCompany.opencms.templates.mytemplate/javascript/myScript.js<br>
<br>
Link it as follows:<br>
<script src="<%=cms.link("/system/modules/com.myCompany.opencms.templates.mytemplate/javacript/myScript.js")%>" /><br>
<br>
BTW: the 'cms' object is obtained like this:<br>
<%<br>
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);<br>
%><br>
<br>
Joe<br>
<br>
<br><div><span class="gmail_quote">On 9/12/05, <b class="gmail_sendername">pat sad</b> <<a href="mailto:hlp.psaad@gmail.com">hlp.psaad@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hy All,<br><br>I want to include a javascript file to my template. Does anyone know<br>what to include in the head section of my template ?<br><br><br>ex: <script src="menu.js"></script><br><br>Thank you.
<br><br><br>_______________________________________________<br>This mail is send to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://mail.opencms.org/mailman/listinfo/opencms-dev">
http://mail.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote></div><br>