about summary refs log blame commit diff stats
path: root/test/js/docwrite2.html
blob: 876f3cdde01552bcfb60f5dae93ff0f2265319f7 (plain) (tree)






























                                                                                                     
<!DOCTYPE html>
<html lang="en">
<head>
<title>document.write test</title>
<script>
window.onload = function() {
	const success = document.body.innerHTML == document.querySelector("style").textContent;
	while (document.body.childNodes[0])
		document.body.childNodes[0].remove();
	document.body.innerHTML = success ? "Success" : "Fail";
}
let checkpointCounter = 0;
function checkpoint(n) {
	if (++checkpointCounter != n)
		throw new TypeError(`Checkpoint failed: expected ${n} but got ${checkpointCounter}`);
}
</script>
<style><script>
document.write("a");
document.write("<script></scr" + "ipt>x");
document.write("t");
</script>a<script></script>xt

</style>
</head>
<body><script>
document.write("a");
document.write("<script></scr" + "ipt>x");
document.write("t");
</script></body>
</html>