I've got some javascript going on on my pages in addition to Wickets use. However, Wicket only loads jquery on pages where it sees that it is needed. Is there any way to make Wicket load jquery on all pages?
I'd hate to include jquery a second time.
Yes. You can include it in your base page so that it is available for all pages:
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings()
.getJQueryReference()));
}
Wicket is smart enough to not include the reference multiple times if it is requested elsewhere too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With