$.getScript returns status canceled and the application does not execute the callback function?

ridermansb picture ridermansb · Nov 22, 2011 · Viewed 13.7k times · Source

Environment

To automate the compression and the junction of my js files, I use this tool.

Once installed and configured, the code below returns a js compressed and concatenated with all the JS folder project

<script src="@BundleTable.Bundles.ResolveBundleUrl("~/Scripts/pages/project-projectPhotos/js")"></script>

Problem

In my page, have the following code:

loaderPhotosPage = function(url) {
  $.getScript('/Scripts/pages/project-projectPhotos/js', function() {
    alert(url); //This code is not executed!! Here's the problem;
  });
};

alert is never executed!

Tests

To simulate a test tool using Google Chrome Developer Tools, I got the following results:

Code executed on Google Chrome Developer

Look at the console, and the header. The execution is very successful!

Code executed on Google Chrome Developer

Now the preview result

Result of script on Google Chrome Developer

The HTTP status is as canceled, why? Yet the code in the console was running normally (text: success)

Http Status

I put the js file complete at this link.

Another test:

See the get, with the link of the script is running normally!

Get Script

Thanks for the help!

Answer

RichB picture RichB · Dec 6, 2011

The canceled status is an issue with current dev channel Google Chrome. It has been fixed upstream and will propagate to the dev channel accordingly.

https://bugs.webkit.org/show_bug.cgi?id=72873