Leon Wang wrote:
Hi Everyone, Hi Marius, Sorry, last message I have not finished and I pressed the space key mistakenly and it have been sent.
Here is the code that I embeded in the Xwiki page, I just only include js/xwiki/mail/mail.nocache.js just once:
{{velocity}}
$xwiki.jsfx.use("js/xwiki/mail/mail.nocache.js", true)
{{html}}
<div id="DR_TreeView"></div>
{{/html}}
{{/velocity}}
or
{{velocity}}
$xwiki.jsfx.use("js/xwiki/mail/mail.nocache.js", true)
{{/velocity}}
{{html}}
<div id="DR_TreeView"></div>
{{/html}}
This will result at the top of the page that have the clickable Mail example functioning well, at the bottom it follows two unclickable Mail example, just like html displayed. And follows 6 xwe.onInjectionDone('xwe') sep . It seems although I used $xwiki.jsfx.use, the JavaScript code still parsed as wiki syntax and display as text. So what should I do?
Marius, you said "to include the JavaScript code so that it ends up in your HTML page's head not body". Could you explain a little what do you mean by page's body and head?" by head do you mean on the top of the page.
It means the <script> tag will be under the <head> of the resulting document, this wherever you call $xwiki.js(f)x from in the evaluation flow. This is what the JSX plugins have been made for : late dependency declaration. Jerome
Thank you for your help!
Leon _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs