Fórumok

add js to jsp in hook

Dariusz Sawicki, módosítva 12 év-val korábban

add js to jsp in hook

Regular Member Bejegyzések: 165 Csatlakozás dátuma: 2009.03.27. Legújabb bejegyzések
Hello
Hi i can add my script.js to jsp ? I create hook to change behavior on jsp and I want to add my script.js to jsp.
how I should add this file , where I should put it in hook project?
I try put it in:
WEB-INF/js/script.js
and import it in jsp by:
<c:import url="/js/floating-gallery.js" />
but it;s not working.

Abybody can help me ?

Regards
Darek
Venkat Koppavolu, módosítva 12 év-val korábban

RE: add js to jsp in hook

Junior Member Bejegyzések: 85 Csatlakozás dátuma: 2010.07.26. Legújabb bejegyzések
1. liferay-hook.xml
<hook>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
</hook>

2. placed your own js file at html/js/<filename>.js
Ex: html/js/floating-gallery.js

3. include your js from your jsp(which we are trying to customize).
<script type="text/javascript" src="/html/js/foating-gallery.js"></script>

Check the attached file for your reference.

Mellékletek: