1

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?

1
  • 2
    @Doge Keep in mind that Wicket uses Java and the OP is asking how to write Java code to append JavaScript to the DOM using Wicket. Commented Apr 1, 2014 at 15:41

1 Answer 1

2

I think this will work.

int celsius = 0;
target.appendJavaScript("document.write(\"Celsius is: " + celsius + "\")");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.