Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/scripting-1/the-script-element/module/load-error-events.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>load/error events for external module scripts</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/load-error-events-helpers.js"></script>
</head>
<script>
"use strict";
var test1_load = event_test('src, 200, parser-inserted, defer, no async', true, false);
var test4_load = event_test('src, 200, parser-inserted, no defer, async', true, false);
var test3_dynamic_load = event_test('src, 200, not parser-inserted, no defer, no async, no non-blocking', true, false);
var test4_dynamic_load = event_test('src, 200, not parser-inserted, no defer, async', true, false);
var test1_error = event_test('src, 404, parser-inserted, defer, no async', false, true);
var test4_error = event_test('src, 404, parser-inserted, no defer, async', false, true);
var test3_dynamic_error = event_test('src, 404, not parser-inserted, no defer, no async, no non-blocking', false, true);
var test4_dynamic_error = event_test('src, 404, not parser-inserted, no defer, async', false, true);
var script3_dynamic_load = document.createElement('script');
script3_dynamic_load.setAttribute('type', 'module');
script3_dynamic_load.onload = () => onLoad(test3_dynamic_load);
script3_dynamic_load.onerror = () => onError(test3_dynamic_load);
script3_dynamic_load.async = false;
script3_dynamic_load.src = "../resources/load-error-events.py?test=test3_dynamic_load";
document.head.appendChild(script3_dynamic_load);
var script3_dynamic_error = document.createElement('script');
script3_dynamic_error.setAttribute('type', 'module');
script3_dynamic_error.onload = () => onLoad(test3_dynamic_error);
script3_dynamic_error.onerror = () => onError(test3_dynamic_error);
script3_dynamic_error.async = false;
script3_dynamic_error.src = "../resources/load-error-events.py?test=test3_dynamic_error";
document.head.appendChild(script3_dynamic_error);
var script4_dynamic_load = document.createElement('script');
script4_dynamic_load.setAttribute('type', 'module');
script4_dynamic_load.onload = () => onLoad(test4_dynamic_load);
script4_dynamic_load.onerror = () => onError(test4_dynamic_load);
script4_dynamic_load.async = true;
script4_dynamic_load.src = "../resources/load-error-events.py?test=test4_dynamic_load";
document.head.appendChild(script4_dynamic_load);
var script4_dynamic_error = document.createElement('script');
script4_dynamic_error.setAttribute('type', 'module');
script4_dynamic_error.onload = () => onLoad(test4_dynamic_error);
script4_dynamic_error.onerror = () => onError(test4_dynamic_error);
script4_dynamic_error.async = true;
script4_dynamic_error.src = "../resources/load-error-events.py?test=test4_dynamic_error";
document.head.appendChild(script4_dynamic_error);
</script>
<script src="../resources/load-error-events.py?test=test1_load" onload="onLoad(test1_load);" onerror="onError(test1_load);" type="module"></script>
<script src="../resources/load-error-events.py?test=test4_load" onload="onLoad(test4_load);" onerror="onError(test4_load);" type="module" async></script>
<script src="../resources/load-error-events.py?test=test1_error" onload="onLoad(test1_error);" onerror="onError(test1_error);" type="module"></script>
<script src="../resources/load-error-events.py?test=test4_error" onload="onLoad(test4_error);" onerror="onError(test4_error);" type="module" async></script>