<
From version < 4.1 >
edited by Thomas Mortagne
on 2013/03/08
To version < 5.1 >
edited by Caleb James DeLisle
on 2013/03/08
>
Change comment: Document jQuery/AMD/require.js

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.CalebJamesDeLisle
Content
... ... @@ -28,6 +28,23 @@
28 28  
29 29  See [[extensions:Extension.Logging Module||anchor="HTranslatelog"]] for more details.
30 30  
31 +== JQuery in XWiki using AMD/Require.js ==
32 +
33 +Now with [[require.js>>http://requirejs.org/]] you can pull in jQuery and use it when you need it without incurring the performance penalty when you don't need it.
34 +To use jquery, use the script below:
35 +
36 +{{code language="html"}}
37 +{{html}}
38 +<script>
39 +require(['jquery'], function($) {
40 + $('#document-title>h1').text('JQuery in action');
41 +});
42 +</script>
43 +{{/html}}
44 +{{/code}}
45 +
46 +You can learn more about the power of AMD javascript modules by reading [[require.js documentation>>http://requirejs.org/docs/whyamd.html]].
47 +
31 31  == Deprecated and Retired projects ==
32 32  
33 33  <description of deprecated and retired projects>

Get Connected