fetch-polyfill icon indicating copy to clipboard operation
fetch-polyfill copied to clipboard

IE下请求直接到Error callback方法

Open forwk1990 opened this issue 8 years ago • 0 comments

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 {
                                reject({
                                    status: responseObject.status,
                                    message: responseObject.message
                                })
                            }
                        })
                    } else {
                        reject({
                            status: response.status,
                            message: ''
                        })
                    }
                }, function (error) {
                    debugger
                    reject({status: -1, message: error})
                })

IE下直接进入到error方法中,调试ie8,debugger处显示error中的消息为“对象不支持此属性或方法”,应该是内部框架catch到了错误,不知道哪一个对象不支持属性或方法。

forwk1990 avatar Jun 14 '17 09:06 forwk1990