Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
Navein Austin Fernandes
Loading a common javascript file
23 de junio de 2008 4:05
Respuesta

Navein Austin Fernandes

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 23 de junio de 2008

Mensajes recientes

Hi, I am using Liferay Enterprise Portal 4.4.2. I have a requirement wherein I need to load a common javascript file to the portal. This will be accessed by all portlets.

I did refer to link - http://wiki.liferay.com/index.php/Including_Javascript_/_JS_Files_in_a_portlets, but did not seem to work. Any way it is to include a link to all portlets.

Does anyone know how i can achieve this. The reason is that there is a common variable that all portlets need to refer to and some scripts that work on this variable.

I would really be helpful for a solution.

Thanks.
Thiago Leão Moreira
RE: Loading a common javascript file
23 de junio de 2008 9:10
Respuesta

Thiago Leão Moreira

LIFERAY STAFF

Ranking: Liferay Legend

Mensajes: 1433

Fecha de incorporación: 10 de octubre de 2007

Mensajes recientes

Hi Navein,

Take a look at the JavaScript section of the portal.properties file. There you will find more information on how to add js files to the portal page.

Cheers
Juanjo Hernández Cánovas
RE: Loading a common javascript file
14 de abril de 2009 1:00
Respuesta

Juanjo Hernández Cánovas

Ranking: Regular Member

Mensajes: 183

Fecha de incorporación: 11 de agosto de 2008

Mensajes recientes

Navein Austin Fernandes:
Hi, I am using Liferay Enterprise Portal 4.4.2. I have a requirement wherein I need to load a common javascript file to the portal. This will be accessed by all portlets.

I did refer to link - http://wiki.liferay.com/index.php/Including_Javascript_/_JS_Files_in_a_portlets, but did not seem to work. Any way it is to include a link to all portlets.

Does anyone know how i can achieve this. The reason is that there is a common variable that all portlets need to refer to and some scripts that work on this variable.

I would really be helpful for a solution.

Thanks.


Hello Navein, Have you resolve this issue? I also failed to introduce custom javascript by following the paradigm ${easyconf:companyId}.properties.

Thanks for your help

Greetings

Juanjo
Navein Austin Fernandes
RE: Loading a common javascript file
22 de mayo de 2009 5:51
Respuesta

Navein Austin Fernandes

Ranking: New Member

Mensajes: 2

Fecha de incorporación: 23 de junio de 2008

Mensajes recientes

I kind of did it but in a different way which might not be right. The theme of the portal has a portal_normal.vm. I added my script files in this just below the </head> tag. So now it is accessible through out the portal.
If anyone has got some other way of doing it please let me know.

thanks.
Brahim TARNAOUI
RE: Loading a common javascript file
22 de diciembre de 2010 9:21
Respuesta

Brahim TARNAOUI

Ranking: Junior Member

Mensajes: 64

Fecha de incorporación: 15 de junio de 2010

Mensajes recientes

hi,


please how can'i include a javascript file in my jsp ovveriden by hook, my jsp it's week.jspf from calendar portlet.


thx
PRAKASH HARIGOPAL
RE: Loading a common javascript file
23 de diciembre de 2010 15:42
Respuesta

PRAKASH HARIGOPAL

Ranking: Regular Member

Mensajes: 101

Fecha de incorporación: 23 de junio de 2010

Mensajes recientes

It is pretty simple.... Use the import tag

1<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
2<c:import url="../../dojo/dojo-1.3rc1/dojo/dojo.js" />



thanks
prakash.
Brahim TARNAOUI
RE: Loading a common javascript file
24 de diciembre de 2010 1:36
Respuesta

Brahim TARNAOUI

Ranking: Junior Member

Mensajes: 64

Fecha de incorporación: 15 de junio de 2010

Mensajes recientes

hello,

i use the same code, but is not working,
NB:i use a hook, the tree of my app is bellow on image.
my javascript is in WEB-INF/js/functions.js ou in calendar/js/functions.js
this is my code added in view.jsp page.
1
2<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
3<c:import url="/js/functions.js" />




thx in advance
Adjunto

archivos adjuntos: tree.jpg (27,1k)