3.3.1.3. Using eXo Platform jQuery module

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

eXo Platform provides the jQuery library 3.2.1 as a jquery module, the configuration of this module can be found in the eXoResources.war file. To reuse this jQuery version, just declare a dependency over it:


<portlet>
  <name>RequireJSPortlet</name>
  <module>
    <depends>
      <module>jquery</module>
    </depends>
</portlet>

The default jquery module alias is $, so if you are using it, it should be named $ in the self-executing function:

If your library uses a different name, such as jQuery, the XML as tag should be used:


<portlet>
  <name>RequireJSPortlet</name>
  <module>
    <depends>
      <module>jquery</module>
      <as>jQuery</as>
    </depends>
</portlet>

With the following self-executing function:

(function($) {
    ...
}(jQuery)
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus