eaglei22
eaglei22

Reputation: 2831

Using Javascript in Wicket

I find it confusing to incorporate javascript from Wicket using target.appendJavaScript()

What is the structure for doing this:

document.write("Celsius is: " + celsius + "");

in target.appendJavaScript() ?

Lets say celsius is an integer from Java.. how do I include the java variable into the javascript code?

Upvotes: 1

Views: 108

Answers (1)

Mike B
Mike B

Reputation: 5451

I think this will work.

int celsius = 0;
target.appendJavaScript("document.write(\"Celsius is: " + celsius + "\")");

Upvotes: 2

Related Questions