From version < 21.1 >
edited by Guillaume Delhumeau
on 2014/10/27
To version < 22.2 >
edited by Clemens Robbenhaar
on 2014/12/05
< >
Change comment: small typos in comments

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.gdelhumeau
1 +XWiki.ClemensRobbenhaar
Content
... ... @@ -168,12 +168,16 @@
168 168  
169 169  {{code language="javascript"}}
170 170  require(['xwiki-meta'], function (xm) {
171 - xm.document // get he current document (eg: Main.WebHome)
171 + xm.document // get the current document (eg: Main.WebHome)
172 172   xm.xwiki // get the current wiki (eg: xwiki)
173 173   xm.space // get the current space (eg: Main)
174 174   xm.page // get the current page name (eg: WebHome)
175 175   xm.version // get the current document version (eg: 1.1)
176 176   xm.restURL // get the REST url of the current doc (eg: /xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome)
177 - xm.form_token // get the current CSRF token that ou should pass to your script's to avoid CSRF attacks.
177 + xm.form_token // get the current CSRF token that you should pass to your scripts to avoid CSRF attacks.
178 178  });
179 179  {{/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