Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
javascript file in hook
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
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
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.
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.
Hi,
also we can use this:
in liferay-portlet.xml this tags:
it work good, i tested
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