Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
gordon daniels
jquery support
27 de abril de 2012 7:05
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

I am using 6.1ga1 and I know it does not support jquery. I have a coin-slider on 6.0 that works perfectly and I want to use it in 6.1. I've searched the wiki and liferay site for info on how to support jquery in 6.1, but the docs are all cryptic. By that I mean they assume you know java, liferay and what they are talking about without being explicit.

I downloaded jquery and put it into '/html/js/jquery' and modified portal_normal.vm with recommended statement for including javascript. Rebooted server but it does not recognize javascript. Could someone tell me what I am doing wrong? This should be simple but has turned into days being wasted trying to figure it out.

The other issue is two different portlets use different versions of java script. I read in the wiki that you must use 'noconfict' to support multiple versions. However, it does not say where to put the statement. What is the name of the file to modify? I am trying to setup a theme and need to have the answers so I can proceed.

any help from you java wizards would be appreciated. emoticon
Hitoshi Ozawa
RE: jquery support
27 de abril de 2012 7:18
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7949

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

Instruction in the following page is very clear. You didn't need to modify portal_normal.vm. Just modify the liferay-portlet.xml to import jquery.

http://www.liferay.com/web/jonas.yuan/blog/-/blogs/building-jquery-based-plugins-in-liferay-6
gordon daniels
RE: jquery support
27 de abril de 2012 8:58
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

thanks Hitoshi: but I've tried that also, and it throws out 404 error messages about '.js'.

thanks again
Hitoshi Ozawa
RE: jquery support
27 de abril de 2012 9:22
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7949

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

404 error is file not found. Where are you putting your jquery.js file?
gordon daniels
RE: jquery support
27 de abril de 2012 9:33
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

/html/js/jquery : based on blog by jonas.
gordon daniels
RE: jquery support
27 de abril de 2012 10:03
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

Hitoshi: jonas is talking about building a plugin in that link. So, he recommends '/docroot/jsp'. I am not building a theme. I've already deployed the theme before I discovered that it did not support jquery. So, isn't the proper place to put jquery.js is in 'html/js/jquery'?

thanks
David H Nebinger
RE: jquery support
27 de abril de 2012 10:05
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11046

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

No. You don't want to go messing around with the ROOT web application directory as it will impede your ability to do upgrades (you have to remember to manually do all of the same things you did for the current version and apply them to the new version).

Deploying via a theme is a good way to go. The theme is self contained and will ensure that jquery is available in all pages using the theme.
gordon daniels
RE: jquery support
27 de abril de 2012 10:14
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

David: thanks for answer. Will redeploy theme. My second question in the post was where to put code to support multiple versions of jquery. Do you know?
David H Nebinger
RE: jquery support
27 de abril de 2012 10:18
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11046

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

Eww, you really don't want to have to do that if you can help it...

Otherwise you'll have the different versions of jquery in the js folder and can pull them in, but you'll have to do the jquery magic to get expected results, although it's still going to be rough...

http://forum.jquery.com/topic/multiple-versions-of-jquery-on-the-same-page
gordon daniels
RE: jquery support
27 de abril de 2012 10:27
Respuesta

gordon daniels

Ranking: Liferay Master

Mensajes: 723

Fecha de incorporación: 23 de agosto de 2008

Mensajes recientes

lol: David thanks for the help! Will try to figure this out.