我有一个静态json文件myjson.json,该文件已经使用JSONLint进行了验证。
我试图使用这个静态的json将数据添加到集合中,但我仍然得到相同的错误:
XMLHttpRequest cannot load file:///C:/Testing/app/scripts/src/myjson.json. Received an invalid response. Origin 'null' is therefore not allowed access.
我不知道为什么fetch()中的success没有触发。
我的文件夹结构如下所示
->index.html