Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ClemensRobbenhaar1 +XWiki.mflorea - Content
-
... ... @@ -162,6 +162,22 @@ 162 162 163 163 The best part is, any scripts which are loaded using require are loaded //asynchronously// (all at the same time) and if they are not required, they are never loaded at all. 164 164 165 +== Bridging custom XWiki events from Prototype to jQuery == 166 + 167 +Starting with XWiki 6.4 you can catch from jQuery the custom XWiki events that are fired from Prototype. 168 + 169 +{{code language="js"}} 170 +require(['jquery', 'xwiki-events-bridge'], function($) { 171 + $('.some-element').on('xwiki:moduleName:eventName', function(event, data) { 172 + // Here, do something that will be executed at the moment the event is fired. 173 + doSomething(); 174 + 175 + // The passed data is a reference to the event.memo from Prototype. 176 + console.log(data.somethingINeedToKnow); 177 + }); 178 +}); 179 +{{/code}} 180 + 165 165 = Get some informations about the current document = 166 166 167 167 In your javascript's applications, you can get some (meta) informations about the current document, though an AMS module.