且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

$ .getScript返回状态已取消,应用程序不执行回调函数?

更新时间:2023-12-04 22:59:58

取消状态是当前开发者频道Google Chrome的问题。它已在上游修复,并相应地传播到开发通道。



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


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!

Now the preview result

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

I put the js file complete at this link.

Another test:

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

Thanks for the help!

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