JavaFX WebView: how can I load webjars?

113 views Asked by At

I installed the jquery webjar with gradles:

implementation group: 'org.webjars', name: 'jquery', version: '3.3.1'

How do I use the resulting webjar from JavaFX WebView? The location of the file is

META-INF/resources/webjars/jquery/3.3.1/jquery.min.js

I then load the content of the WebView with webEngine.loadContent(content). Said content includes

<script src="webjars/jquery/3.3.1/jquery.min.js"></script>

However, jquery isn't loaded for some reason.

Alternatively, I tried

<script src="META-INF/resources/webjars/jquery/3.3.1/jquery.min.js"></script>

and

<script src="/META-INF/resources/webjars/jquery/3.3.1/jquery.min.js"></script>

But jquery still doesn't work.

What am I doing wrong?

0

There are 0 answers