为什么总是报错,fetch is not a function?
发布于 5 年前 作者 qdai 12933 次浏览 来自 问答

const url = ‘https://api.douban.com/v2/movie/in_theaters’ 

fetch(url).then(function(response) {

     return  response.json();

     }).then(function (data) {

        that.setData({

          filmlist: data.subjects

        })

      })

    哪里错了呀?

fetch使用有什么需要注意的吗?

5 回复

东西两个字也会屏蔽?

应该是“有些东西”

小程序提供了发出请求的 API。

fetch(url, {

   credentials: ‘include’,

            headers: {

                ‘Accept’: ‘application/json, text/plain, */*’

            },

        });

就是有些。。用不了,最简单的例子 alert()

回到顶部