[xwiki-devs] Refer to attached javascript file with $xwiki.jsfx.use
I have a page "Test6" in space "Algemeen". On that page I have uploaded "three.min.js", a javascript file. I want to use that script, but how? {{velocity}} $xwiki.jsfx.use('Algemeen/Test6/three.min.js') {{/velocity}} If I use this and then look at the DOM, then this is what I see: It refers to the colibri skin...but that's not where my "three.min.js" is located. Any help is appreciated! -- View this message in context: http://xwiki.475771.n2.nabble.com/Refer-to-attached-javascript-file-with-xwi... Sent from the XWiki- Dev mailing list archive at Nabble.com.
$xwiki.jsfx.use() works only for the JavaScript files located on the file system inside the 'resources' folder. You should use Require.js instead. See: https://github.com/xwiki-contrib/application-filemanager/blob/master/ui/src/... http://platform.xwiki.org/xwiki/bin/view/DevGuide/JavaScriptAPI#HRequireJSan... Hope this helps, Marius On Tue, Mar 24, 2015 at 5:59 PM, Hamster <[email protected]> wrote:
I have a page "Test6" in space "Algemeen". On that page I have uploaded "three.min.js", a javascript file.
I want to use that script, but how?
{{velocity}} $xwiki.jsfx.use('Algemeen/Test6/three.min.js') {{/velocity}}
If I use this and then look at the DOM, then this is what I see:
It refers to the colibri skin...but that's not where my "three.min.js" is located.
Any help is appreciated!
-- View this message in context: http://xwiki.475771.n2.nabble.com/Refer-to-attached-javascript-file-with-xwi... Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Thanks for the pointers Marius. I am not a vivid Java programmer, so I need examples to make my stuff work :-) Any tutorial (or small program) which demonstrates the use of Require.js to make use of an attached JavaScript file? -- View this message in context: http://xwiki.475771.n2.nabble.com/Refer-to-attached-javascript-file-with-xwi... Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (2)
-
Hamster -
Marius Dumitru Florea