I've asked why the below doesn't work and got a very clear answer.
<head>
...
<script src="Stuff.js" type="text/javascript"></script>
</head>
<body>
...
@Scripts.Render("~/bundles/jquery")
</body>
So I've changed that into this.
<head></head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/Stuff.js")
</body>
However, I get the same misbehavior. Based on the diagnostics from the linked answer, I'm guessing that the scripts still don't render in the right order. How do I control it? Should I move both to header instead?
The generated markup ends like this.
</form>
</div>
<script src="/Scripts/jquery-1.10.2.js"></script>
<script src="Stuff.js"></script>
</body>
</html>
As asked - I'm adding a screenshot of the network tab showing scripts. There are other resources as well (images and stuff) but none of them is 4xx, no weird messages and I've turned them each off, still hitting the same problem.
Working in Default.js (formerly Stuff.js).
window.onload = function() {
console.log($(this));
};
Producing error in Default.js (any of the lines).
//$(document).ready(function () { alert("ready"); });
$(window).onload(function () { alert("onload"); });