Drake
Drake

Reputation: 165

Ajax call doesn't work when debug="false" (ASP.NET MVC)

How can I resolve my problem? When I call

jQuery.ajax(my_ajax_request); or $.ajax(my_ajax_request);

with debug="true" it works correctly and doesn't work if debug="false"

P.S. I'm using bundles

Upd.:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

Upvotes: 0

Views: 351

Answers (1)

vivek
vivek

Reputation: 1605

Your bundle configurations seems correct. When debug="false" is used, the min version of libraries is used. You can also use CDN for the same. For debugging the problem, You should check these:

  1. Check for Jquery and related libraries versions for any compatibility issues. Not all packages are compatible with each other.
  2. Read Official post about bundling and minification for more details.

Thanks

Upvotes: 1

Related Questions