mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
20 lines
730 B
HTML
20 lines
730 B
HTML
<script src="include.js"></script>
|
|
<script>
|
|
let goodLink = document.createElement("link");
|
|
goodLink.setAttribute("rel", "preload");
|
|
goodLink.setAttribute("href", "valid.css");
|
|
goodLink.setAttribute("as", "style");
|
|
goodLink.addEventListener("load", function() {
|
|
println("Got load event");
|
|
});
|
|
document.head.appendChild(goodLink);
|
|
|
|
let badLink = document.createElement("link");
|
|
badLink.setAttribute("rel", "preload");
|
|
badLink.setAttribute("href", "this-file-does-not-exist-and-so-is-invalid.css");
|
|
badLink.setAttribute("as", "style");
|
|
badLink.addEventListener("error", function() {
|
|
println("Got error event");
|
|
});
|
|
document.head.appendChild(badLink);
|
|
</script>
|