[opencms-dev] OCcms 5 - Javascript in JSP template??

Xavier Ottolini xavier.ottolini at adelis.com
Thu Feb 17 15:44:27 CET 2005


You should use the absolute Path
<script type="text/javascript" language="JavaScript" 
src="<cms:link>/system/modules/com.mycompany.myproject/resources/homepage.js</cms:link>"></script>

Xavier Ottolini
Développeur multimédia

Adelis
37, rue d'Engwiller
67350 La Walck
Téléphone : +33 (0) 3 88 72 29 10
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com




James a écrit :

> I can’t get my javascript working from my template. Any ideas why?
>
> My jsp template code (part):
>
> <head>
>
> <script language="JavaScript" type="text/javascript">
>
> <!--
>
> <cms:include page="../resources/homepage.js" />
>
> -->
>
> </script>
>
> <title><cms:property name="title" escapeHtml="true"/></title>
>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>
> <style type="text/css">
>
> <!-- <cms:include page="../resources/home.css" />
>
> <cms:include page="../resources/global.css" /> -->
>
> </style>
>
> <title>Creative Portal: Homepage</title>
>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
>
> <link href="stylesheets/home.css" rel="stylesheet" type="text/css" />
>
> </head>
>
> <body onload="swapImg(); swapImg2(); 
> simplePreload('../resources/home_button_selected.gif' , 
> '../resources/home_button.gif' , '../resources/my_region_button.gif' , 
> '../resources/learning_button.gif' , 
> '../resources/community_button.gif' , 
> '../resources/opportunities_button.gif' , 
> '../resources/news_button.gif' , '../resources/advice_button.gif' , 
> '../resources/links_button.gif' , '../resources/home_button_over.gif' 
> , '../resources/my_region_over.gif' , 
> '../resources/learning_button_over' , 
> '../resources/community_button_over.gif' , 
> '../resources/opportunities_button_over.gif' , 
> '../resources/news_button_over.gif' , 
> '../resources/advice_button_over.gif' , 
> '../resources/links_button_over.gif');">
>
> Am I adding the onload event to the body tag in the correct way?
>
> Thankyou………
>
>------------------------------------------------------------------------
>
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
>



More information about the opencms-dev mailing list