How to parse a JSON file without web request or web server?

前端 未结 5 833
旧巷少年郎
旧巷少年郎 2021-01-21 21:08

Looking to build a work-around of the following.

$.getJSON(\'myfile.json\', function (data) {
    showAll(data);
});

I want to avoid using a we

5条回答
  •  不要未来只要你来
    2021-01-21 21:19

    If it is static JSON resource, why make another network request. Network is expensive. You can change to .js and include the file in the page.

提交回复
热议问题