I have a page where I have something like this at the end of the page:

```
<script src="jquery.js"></script>
<script src="onload-test.js"></script>
</body>
</html>

```

In my network tab it shows everything being loaded using `h2` (http/2) and `onload-test.js` is **loaded before** `jquery.js` causing an error 

> 
> "Uncaught ReferenceError: $ is not defined"
> 
> 
> 

as I am using `$(document).ready()` in my script. The network tab shows **jquery.js being queued for ~200m**s.

Under what circumstances can this happen? and how can it be prevented?