简体   繁体   English

检票口:模板化 javascript 在?

[英]Wicket: templatized javascript in <body>?

Previously I've used TextTemplateHeaderContributor.forJavaScript() to add Javascript to the page <head> from a template file.以前我使用TextTemplateHeaderContributor.forJavaScript()将 Javascript 从模板文件添加到页面<head>

Is there any way to do the same thing, but have the interpolated JS appear in the page <body> ?有没有办法做同样的事情,但是插入的 JS 是否出现在页面<body>中?

See org.apache.wicket.util.template.TextTemplate and its family.请参阅 org.apache.wicket.util.template.TextTemplate 及其系列。 You can feed it, interpolate and get its content (#getString()), then you can render the string in a Label for example.您可以输入、插入并获取其内容 (#getString()),然后您可以在 Label 中渲染字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM