📌  相关文章
📜  从 json 文件中获取数据 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:36.455000             🧑  作者: Mango

代码示例1
const fetchData = async () => {
  try {
    const res = await fetch("js/data.json");
    data = await res.json();
    displayData(data);
  } catch (e) {
    console.log("something went wrong!", e);
  }
};

fetchData();