Foros de discusión

jquery support

gordon daniels, modificado hace 11 años.

jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 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
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: jquery support

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 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, modificado hace 11 años.

RE: jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 Mensajes recientes
thanks Hitoshi: but I've tried that also, and it throws out 404 error messages about '.js'.

thanks again
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: jquery support

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
404 error is file not found. Where are you putting your jquery.js file?
gordon daniels, modificado hace 11 años.

RE: jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 Mensajes recientes
/html/js/jquery : based on blog by jonas.
gordon daniels, modificado hace 11 años.

RE: jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 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
thumbnail
David H Nebinger, modificado hace 11 años.

RE: jquery support

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 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, modificado hace 11 años.

RE: jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 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?
thumbnail
David H Nebinger, modificado hace 11 años.

RE: jquery support

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 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, modificado hace 11 años.

RE: jquery support

Liferay Master Mensajes: 797 Fecha de incorporación: 24/08/08 Mensajes recientes
lol: David thanks for the help! Will try to figure this out.