fetch-polyfill
fetch-polyfill copied to clipboard
fetch polyfill which supports all mainstream browsers, even IE6, IE7, IE8.....
https://github.com/RubyLouvre/fetch-polyfill/blob/0ec48d47e02b82e8e4fb79618db929ceae507cf6/src/transports/jsonp.js#L2-L51 1 所有的方法没有挂在原型上面, 全是挂在xhr上面的, 不应挂在原型上吗, 或者 this.xhr = xhr 最后导致 new JSONP出来是一个空到实例 2 open 方法将节点 挂在 head中, 不是应该是getElementsByTagName,原文是getElementsTagName 实在没在文档上找到这个方法。 3 remove 方法, 命名节点插入到dom 中, 为什么 ``` var f = document.createDocumentFragment()...
``` fetch(url, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: params })。then(function (response) { if (response.ok) { return response.json().then(function (responseObject) { if (responseObject['status'] == 1) { resolve(responseObject.data) } else...