I made sure to verify that my reference to the jQuery is correct like so.
window.onload = function() {
console.log($(this));
};
I get to see non-null value. But when I try any of the below (the part above commented out), I get the error.
Uncaught ReferenceError: $ is not defined
//$(document).ready(function () { alert("ready"); });
$(window).onload(function () { alert("onload"); });
I'm confused how it can be defined and not defined at the same time. After some googling I've found several code samples like this and as far I can see, it's not a syntax in the file.
The markup is like so.
<head>
...
<script src="Stuff.js" type="text/javascript"></script>
</head>
<body>
...
@Scripts.Render("~/bundles/jquery")
</body>
I've seen in the default (and working) template for MVC.NET under Razor that they do @Scripts.Render("~/bundles/modernizr")
in the head, and then @Scripts.Render("~/bundles/jquery")
at the bottom of the body. I figured that I could follow the same pattern. Evidently, I failed. Sorry for being unclear. Incorrect diagnostics due to ignorance.