Question

I just browsed through tons of googled pages to solve this problem, but it looks like that each of it is unique. My page source shows that the pack is bundled in the way that it should work

 <script src="/Content/js?v=N2f3Y-Z24wBpC67A34qPxjK1CR3eY83Yijs13VtHOwI1"></script>

,but the browser(chrome) dev tool indicates that it failed to load it:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53608/Content/js/

And, and also I get microsoft generated message that resourse is missing or not found if i click on script src link as well.

I get other bundles (styles) to load alright, I guess, I missed something in my code layout, and I cant find the problem myself. I'd be really grateful if any of you could point my mistake there, so here goes the code:

_Layout.cshtml

    @Styles.Render("~/Content/css")
    @Scripts.Render("~/Content/js")
    @Scripts.Render("~/bundles/jquery")

BundleConfig.cs

            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-1.9.1.js",//(tried other numbers as well)
                    "~/Scripts/jquery-ui-1.10.4.js",
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*",
                    "~/Scripts/modernizr-*",
                    "~/Scripts/itpoverlay.js"
                    ));

        bundles.Add(new StyleBundle("~/Content/css").
            Include("~/Content/bootstrap.css",
            //"~/Content/ie.css",
            "~/Content/kwicks-slider.css",
            "~/Content/style.css",
            "~/Content/custom.css",
            "~/Content/responsive.css",
            "~/Content/touchTouch.css"));

        bundles.Add(new ScriptBundle("~/Content/js").Include(
          "~/Content/js/bootstrap.js",
          "~/Content/js/forms.js",
          "~/Content/js/jquery.easing.1.3.js",
          "~/Content/js/jquery.flexslider-min.js",
          "~/Content/js/jquery.kwicks-1.5.1.js",
          "~/Content/js/jquery.preloader.js",
          "~/Content/js/superfish.js",
          "~/Content/js/jquery.js",//(default bundle v1.8.1)
          "~/Content/js/touchTouch.jquery.js"));
       BundleTable.EnableOptimizations = true;

_references.js (I literally have no idea why it's there)

/// <reference path="jquery-1.9.1.js" />
/// <reference path="jquery-ui-1.10.4.js" />
/// <reference path="jquery.unobtrusive-ajax.js" />
/// <reference path="jquery.validate.js" />
/// <reference path="jquery.validate.unobtrusive.js" />
/// <reference path="knockout-2.1.0.debug.js" />
/// <reference path="modernizr-2.5.3.js" />

Now for the output, the bundles look well generated:

    <link href="/Content/css?v=NASaW-JeM0CkSMQIcoasDpn9k7bKaEK07c7WakA1Y0k1" rel="stylesheet"/>
    <script src="/Content/js?v=N2f3Y-Z24wBpC67A34qPxjK1CR3eY83Yijs13VtHOwI1"></script>
    <script src="/bundles/jquery?v=VwkJeyosUZnIv9pTtkEir1OOQCcR7BXo1RW8kdleacU1"></script>

And the dev tool marks list of the errors (I think, I'm starting to get what that _reference.js might be used for) Should it be bundled as well? The errors:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53608/Content/js/
Uncaught TypeError: Object [object Object] has no method 'live' jquery?v=VwkJeyosUZnIv9pTtkEir1OOQCcR7BXo1RW8kdleacU1:1
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53608/js/jquery.preloader.js

I hope it's enought to spot my mistake, and if there is something unclear, I'll happily update the question with required information. Thanks, Ernis.

Était-ce utile?

La solution

Jquery live method was deprecated in 1.7, and it looks like you are using 1.9

https://api.jquery.com/live/

So it looks like you have two options. Figure out where you are using the live method, and change it to use .on(). I can't give you specific code, because I don't know how you are using .live()

or look into using jquery migrate

http://blog.jquery.com/2013/05/08/jquery-migrate-1-2-1-released/
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top