script-element-json-src.html (554B)
1 <!DOCTYPE html> 2 <title><script> with JSON src</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script> 6 window.log = []; 7 8 const test_load = async_test( 9 "Test that <script> doesn't load when the src is JSON."); 10 window.addEventListener("load", test_load.step_func_done(ev => { 11 assert_array_equals(log, ["error"]); 12 })); 13 </script> 14 <script type="module" src="./module.json" onload="t.unreached_func('JSON src should fail to load')" onerror="log.push('error')"></script>