留言板
jquery support
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.
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.
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
http://www.liferay.com/web/jonas.yuan/blog/-/blogs/building-jquery-based-plugins-in-liferay-6
thanks Hitoshi: but I've tried that also, and it throws out 404 error messages about '.js'.
thanks again
thanks again
404 error is file not found. Where are you putting your jquery.js file?
/html/js/jquery : based on blog by jonas.
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
thanks
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.
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.
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?
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
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