Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1220

Access Java Scrip Extension Variables through Velocity

$
0
0

I made a simple javascript extension:

var String;
alert(String);

Now, in my Page where i use this script i have the following Velocity command

{{velocity}}
#set($String = “Hello World”)
$xwiki.jsx.use(‘TEST’)
{{/velocity}}

I want the string that is created in the page to be used in the javascript, so i can use the same script multiple times with a small change of the string.

f.e.

{{velocity}}
#set($String = “Hello World”)
$xwiki.jsx.use(‘TEST’)
{{/velocity}}

and later

{{velocity}}
#set($String = “Hello World 2”)
$xwiki.jsx.use(‘TEST’)
{{/velocity}}

any Ideas?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1220

Trending Articles