문제

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