blob: 38e8398cb87d2fa03715be1d04ea52fcefcc8c37 [file] [log] [blame]
<?php
header("Link: <resources/success.js>; rel=preload; as=script", false);
?>
<script src="../../resources/js-test-pre.js"></script>
<script>
jsTestIsAsync = true;
description("First load a script with a wrong charset then again with the right one. Second attempt should work and 'scriptSuccess' should be set to true. 'successfullyParsed' will be undefined.");
function appendScriptWithCharset(charset, onload)
{
var script = document.createElement("script");
script.src = "resources/success.js";
script.setAttribute("charset", charset);
script.onload = onload;
script.onerror = onload;
document.body.appendChild(script);
}
function test()
{
appendScriptWithCharset("utf-16", function () {
appendScriptWithCharset("utf-8", function () {
shouldBeTrue("scriptSuccess");
finishJSTest();
});
});
}
</script>
<body onload="test()">
<script src="../../resources/js-test-post.js"></script>