Can I have different jQuery versions in Liferay?
Company Blogs July 3, 2010 By Julio Camarero Staff
Yes, you can! We have seen lately many people asking about this in the forums and several projects.
Liferay 5.2 uses uses jQuery 1.2.6. and many people wonder if they can use a different version for their plugins or themes. The answer is yes :)
If you are using Liferay 6, the portal uses Alloy UI instead of jQuery, which means that you can use whatever version of jQuery you need for your custom developments.
If you are using Liferay 5.2.x, you may have noticed that Liferay uses jQuery 1.2.6. Upgrading liferay to use a new library may be hard. New versions of jQuery are not backwards compatible and several features (such as drag and drop) may break.
However, a nice solution is to keep liferay using jQuery 1.2.6 and make your custom portlets or themes use a newer version if needed. This can be easily done using the method jQuery.noConflict(); .
We have created a wiki page called Several jQuery versions within Liferay which will help you to understand more technical details. Feel free to add more examples about it!
See you soon!
Edited: Please, read the wiki page for the latest details about this. For example, in several versions of jQuery, this will only work if you do jQuery.noConflict(true) instead of jQuery.noConflict()