0

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*"));
6
  • Have you checked the page for any missing files, when debug mode is changed? Commented Jul 23, 2016 at 5:20
  • <script src="/bundles/jquery?v=somehashcode"></script> Commented Jul 23, 2016 at 5:27
  • In browser, Open developer tools. Do you see any errors? Commented Jul 23, 2016 at 5:44
  • Object doesn't support property or method 'addEventListener' jQuery' is undefined The value of the property '$' is null or undefined, not a Function object Commented Jul 23, 2016 at 5:49
  • Now, I am sure that your bundle configurations are not correct. Please post the code to check further. Commented Jul 23, 2016 at 6:14

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.