I am using a complex HTML5 page, but removed all Javascript, so it seems:
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>My Page</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script>
function onLOAD() {
console.log("Hello onLoad!")
d3.json("./myData.json", function(data) { // tested also (error, data)
console.log("Hello data!", data);
});
console.log("!Bye!")
} // \onLOAD
</script>
</head>
<body onload="onLOAD()">
... future use with myData ...
<section><h1>... ETC..</h1>...</section>
...
</body>
</html>
No error message or "hello data" on console. Tested with Firefox and Chrome.