cancel
Showing results for 
Search instead for 
Did you mean: 

Should I use JQuery in the client-side javascripts?

sunquanbin
Champ on-the-rise
Champ on-the-rise
Hi All,

I'm currently using JQuery in the client-side javascript files for the Share webscripts.The JQuery reference was added in the .ftl file of the webscript:

<@markup id="js">
   <#– JavaScript Dependencies –>   
   <@script src="${url.context}/res/jquery/jquery-1.10.2.min.js" group="myGroup"/>
   <@script src="${url.context}/res/jquery/jquery-ui-1.10.4.custom.min.js" group="myGroup"/>
</@>


It works fine so far but I'm also aware that Share was using YUI for its client-side javascript. So it will be grateful if anyone can help with my following questions:

1. Should I learn YUI and use it instead of JQuery in my own javascript?
2. If so, which version of YUI should I look at?
3. If not, it there a way to import JQuery as a global object so it doesn't need to import in every .ftl template file?

Regards,

Sun
2 REPLIES 2

mlagneaux
Champ on-the-rise
Champ on-the-rise
Hello,

I think that you should keep using JQuery since AFAIK Alfresco is going to progressively replace YUI by dojo.
Concerning the import of JQuery, perhaps the best way is to override resources.get web script (in particular the resources.get.html.ftl).

ddraper
World-Class Innovator
World-Class Innovator
It appears to be a common misconception that YUI is going to be replaced by Dojo. Alfresco has developed a new UI framework (with the project name "Aikau") which is based around the concept of AMD (asynchronous module definition). It is true that the Dojo AMD loader is being used and that we are creating widgets that are based on the Dojo widget templates, however it is completely untrue to say that we will use Dojo over and above any other JavaScript toolkit. The purpose of Aikau is not to tie ourselves to any specific toolkit and we are using YUI2, JQuery, Dojo, TinyMCE  and other 3rd party JavaScript libraries in our new widgets. We intend to use the best tool for the job in all cases.

I would recommend that you use whatever JavaScript framework that you're comfortable with and that solves your problems, but above everything else you should have a good understanding of pure JavaScript.

Regards,
Dave
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.