问题
Is there a way to write fetch {mode: 'no-cors'} in an existing (and most browsers supported) HTTP request? As an example, I would like to know if it's possible to translate this:
fetch(url, { mode: 'no-cors'})
.then(function (response) {
console.log(response);
});
Into a XMLHttpRequest or Ajax of some sort. I tried several ways and they behave differently - I just want the opaque response that fetch returns.
Thanks!
来源:https://stackoverflow.com/questions/54660924/equivalent-of-fetch-no-cors-mode-in-xhr-or-ajax-libraries