开发者

Set variable value in javascript from wicket

开发者 https://www.devze.com 2023-02-10 16:36 出处:网络
I am trying to开发者_运维百科 set a value to a variable defined in a javascript file from wicket.

I am trying to开发者_运维百科 set a value to a variable defined in a javascript file from wicket.

Basically I want to pass the set the value of any variable to handlerAjax.getCallbackUrl() so that I could then use that variable in wicketAjaxGet


This will do it.

Wicket Page Component:

Label myScript = new Label("myScript", "url = '" + behave.getCallbackUrl() + "';");
myScript.setEscapeModelStrings(false);
add(myScript);

Add this in html header part

<script type="text/javascript" wicket:id="myScript"></script>

actual call:

var wcall = wicketAjaxGet(url + '', function() { }, function() { });
0

精彩评论

暂无评论...
验证码 换一张
取 消