From version < 20.1 >
edited by Guillaume Delhumeau
on 2014/10/27
To version < 22.1 >
edited by Guillaume Delhumeau
on 2014/10/27
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -165,6 +165,7 @@
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.
168 +
168 168  {{code language="javascript"}}
169 169  require(['xwiki-meta'], function (xm) {
170 170   xm.document // get he current document (eg: Main.WebHome)
... ... @@ -176,3 +176,7 @@
176 176   xm.form_token // get the current CSRF token that ou should pass to your script's to avoid CSRF attacks.
177 177  });
178 178  {{/code}}
180 +
181 +{{warning}}
182 +It is actually the only clean way. In the past, we used to add some <meta> tags in the <head> section of the page, but is not even valid in HTML5. So now we have introduced this API that we will maintain, meanwhile relying on any other element in the page could be broken in the future!
183 +{{/warning}}

Get Connected