【发布时间】:2021-11-09 21:45:52
【问题描述】:
我正在尝试从 JSON 文件中提取我的数据,我什至使用 .map() 来映射数据,但它最终显示 result.map() 不是定义函数的错误。我如何显示提取数据
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JSON Test</title>
</head>
<body>
<div id="myData"></div>
<!-- Here a loader is created which
loads till response comes -->
<div class="d-flex justify-content-center">
<div class="spinner-border"
role="status" id="loading">
<span class="sr-only">Loading...</span>
</div>
</div>
<h1>Registered Employees</h1>
<!-- table for showing data -->
<table id="employees"></table>
</body>
<script src="api1-2.js"></script>>
</html>
【问题讨论】:
标签: javascript html css json