ASP.MVC not loading jQuery package

I have defined a bundle:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-1.8.3.min.js"));

      

My layout looks like this:

<!DOCTYPE HTML>
<html lang="en-US" dir="ltr">
<head id="ctl00_Head1">
    <title>Test</title>
    @*<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>*@
    @Scripts.Render("~/bundles/jquery")
</head>
<body id="UCG">
    @RenderBody()
    <script type="text/javascript">
        $(document).ready(new function () {
            alert('test');
        });
    </script>
</body>
</html>

      

My gaze is minimal and insignificant. I have no idea why ASP.MVC (4) is not loading jQuery with packages while commenting out, standard

+3


source to share


2 answers


include unlimited version (jquery-1.8.3.js). Since packages already minify files, they do not work if they have already been minified.



+5


source


Replace

$(document).ready(new function () {
            alert('test');
        });

      



C (no new keyword required here)

$(document).ready(function () {
            alert('test');
        });

      

+1


source







All Articles