Javascript Fetch 不适用于 Edge 上的 URLsearchparams

有人可以向我解释为什么这段代码不会在Edge上产生http请求吗?https://jsfiddle.net/sectioni/tyr5fLgc/1/


let url = "/test.aspx";


// don't change this to a const because the append will not work in Edge

let data = new URLSearchParams();

data.append("userPreferences", "bla");


let promise = fetch(url, {

  method: "POST", // POST, PUT, DELETE, etc.

  body: data,

  cache: "no-cache", // no-store, reload, no-cache, force-cache, or only-if-cached

  keepalive: true

});

它确实适用于Chrome和Firefox,如果您删除身体部分,请求将在Edge上发送。


鸿蒙传说
浏览 178回答 1
1回答

慕的地6264312

看起来,由于Edge已经切换到使用Chromium,现在可以直接下载Edge以进行更新。使用 Edge 81 进行测试后,问题不再出现。这将使它成为旧版Edge的错误。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript