像这样将 javascript 文件添加到我的 Wicket 面板后
renderJsHeaderItem(response, "js/jquery/dist/jquery.min.js");
我在javascript控制台中遇到错误
GET http://localhost:9080/js/jquery/dist/jquery.min.map 404 (Not Found)
如何将地图文件添加到我的面板代码?(对于 css.map 的同样问题)
谢谢!
像这样将 javascript 文件添加到我的 Wicket 面板后
renderJsHeaderItem(response, "js/jquery/dist/jquery.min.js");
我在javascript控制台中遇到错误
GET http://localhost:9080/js/jquery/dist/jquery.min.map 404 (Not Found)
如何将地图文件添加到我的面板代码?(对于 css.map 的同样问题)
谢谢!
Wicket 6 comes with jquery so you dont have to add it again. You should add javascript and css files in your base page, that way all of the pages that extend the base page will have these files available and you only have to add them in one file.
To add javascript or css in renderHead use:
JavaScriptHeaderItem.forUrl("js/jquery/dist/jquery.min.js");
CssHeaderItem.forUrl("css/style.css");
Example:
@Override
public void renderHead(IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forUrl("js/jquery/dist/jquery.min.js"));
response.render(CssHeaderItem.forUrl("css/style.css"));
}