<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<script> | |
function createImportLink(doc, url) | |
{ | |
var link = doc.createElement("link"); | |
link.setAttribute("rel", "import"); | |
link.setAttribute("href", url); | |
link.addEventListener("load", handleEvent); | |
link.addEventListener("error", handleEvent); | |
doc.head.appendChild(link); | |
window.scheduledImportCount++; | |
} | |
var doc = document.currentScript.ownerDocument; | |
createImportLink(doc, "no-such-file.html"); | |
createImportLink(doc, "hello.html"); | |
</script> | |
</body> | |
</html> |