I made sure my jQuery reference is correct.
window.onload = function() {
console.log($(this));
};
I get to see a nonzero value. But when I try to execute any of the following (commented on the part above), I get an error message.
Unprepared ReferenceError: $ undefined
$(window).onload(function () { alert("onload"); });
I am confused by how it can be defined and not defined at the same time. After some googling, I found some code examples like this , and as far as I can tell, this is not the syntax in the file.
The markup looks like this.
<head>
...
<script src="Stuff.js" type="text/javascript"></script>
</head>
<body>
...
@Scripts.Render("~/bundles/jquery")
</body>
( ) MVC.NET Razor, @Scripts.Render("~/bundles/modernizr") , @Scripts.Render("~/bundles/jquery") . , . , . . - .
user1675891