问题
Here is the <head> tag of content.html:
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<script type="text/javascript" src="codemirror.js"></script>
<link rel="stylesheet" href="codemirror.css">
<script type="text/javascript" src="matchbrackets.js"></script>
<script type="text/javascript" src="closebrackets.js"></script>
<script type="text/javascript" src="expression.js"></script>
<style>
.right {
text-align: right;
}
</style>
</head>
File is loaded via:
view.getEngine().load(getClass().getResource("content.html").toExternalForm());
HTML file loads just fine, but none of the files referenced with src or href (css/js). All linked files are in the same package as HTML file. So is the class that loads it.
回答1:
Ok, just tried to compile it with old 1.8_45 JDK and it works as intended, so it seems like some major fault on Orracle's side.
Update:
Bug fixed in Java 8u72 !
来源:https://stackoverflow.com/questions/32280069/webengine-is-not-loading-files-linked-in-html-javafx