javascript file in hook

5087334, modified 15 Years ago. Junior Member Posts: 64 Join Date: 6/15/10 Recent Posts
hi everybody,

i use a hook for customizing the calender portlet, and i add a javascript functions in a file named functions.js, when i will make my file, in hook or directly with the Liferay's js? and how can'i including in my jsp ovveriding by hook, directly in js or via a configuration file like liferay-portlet.xml or another?



thx in advance
thumbnail
6307875, modified 15 Years ago. Junior Member Posts: 25 Join Date: 11/1/10 Recent Posts
Hi,

You can fix it using liferay-util:html-top tag in your jsp file.

<liferay-util:html-top>
<script src="/html/js/my.js" type="text/javascript"></script>
</liferay-util:html-top>

Hope it helps.
5087334, modified 15 Years ago. Junior Member Posts: 64 Join Date: 6/15/10 Recent Posts
Hi,
also we can use this:
in liferay-portlet.xml this tags:


<header-portlet-javascript>/js/main.js</header-portlet-javascript>
or
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>


it work good, i tested