سؤال

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?

هل كانت مفيدة؟

المحلول

I think this will work.

int celsius = 0;
target.appendJavaScript("document.write(\"Celsius is: " + celsius + "\")");
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top