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

二次信任 提交于 2019-12-07 12:33:38

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/8227422/getscript-returns-status-canceled-and-the-application-does-not-execute-the-cal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!