At first glance, it was a bit of a react, but it was very smooth (so forget the details) when you used NG and when you wrote a similar function. Why can't jquery do that? Looked at the specific scene, found that the original JQ Ajax callback has put the response data fool-type in the form of a string parsing.
Check GG, found that the domestic solution is not practical JQ in this scenario, but manually create XMLHttpRequest. Although this method is reliable, the previously encapsulated JQ Ajax cannot be used.
After checking JQ's documents, I intended to expand the data type according to the Jquery.ajaxsetup () interface provided by JQ. Later, on the GitHub found a JQ plug-in package good.
And then we can write this:
However, from the source of the plug-in, it is also manually building a XMLHttpRequest object to send Ajax, but compatibility can be a problem. I want to delve into this.
The above is a small set to introduce the jquery Ajax download blob file, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!