<body>
<table border="1" style="width:100%;">
<tr>
<td>编号</td>
<td>姓名</td>
<td>年龄</td>
<td>操作</td>
</tr>
<tbody id="SHuos">
</tbody>
</table>
姓名: <input type="text" id="name" />
<br> 年纪:
<input type="text" id="age" /><br>
<input type="button" value="保存" onclick="Add()" />
<script>
window.onload = function () {
indata();
}
</script>
<!-- 创建 -->
<script>
var db;
function indata() {
//判断浏览器是否支持
if (window.indexedDB) {
//打开数据库
var request = window.indexedDB.open("Lwy", 1);
//成功事件
request.onsuccess = function () {
console.log("打开成功");
//获取数据库对象
db = request.result;
//判断表是否存在
if (db.objectStoreNames.contains("Tablea")) {
H5做indexedDB存储(增删查)
最新推荐文章于 2024-04-29 17:32:19 发布