Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.MVC doesn't load jQuery bundle

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 View is minimal and insignificant. I have no idea why ASP.MVC (4) doesn't load jQuery using bundles while commented, standard

like image 621
Arkadiusz Kałkus Avatar asked Aug 23 '26 18:08

Arkadiusz Kałkus


1 Answers

include the unminified version (jquery-1.8.3.js). As bundles already minify files, it doesn't work if they are already minified

like image 154
Maximilien Avatar answered Aug 25 '26 09:08

Maximilien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!