<!--
三个核心方法
openDatabase:这个方法使用现有数据库或创建新的数据库
transaction:这个方法允许我们根据情况控制事务提交或者回滚
executeSql:执行sql查询
应用:离线词典
-->
<script>
//检测浏览器是否支持websql
if(window.openDatabase){
//创建或者使用数据库
var conn=openDatabase('think-shop','1.0',1024*1024,function(){});
//控制事务控制提交或者回滚
conn.transaction(function(fx){
/*
//1.执行sql,创建表结构
fx.executeSql(
"create table member(id int,name varchar)",
[],
function(){
//成功自动执行
console.log('创建成功!');
},
function(){
//失败 https://3gimg.qq.com/lightmap/v1/marker/index.html?marker=coord:37.6767600000,112.7297800000&key=TKUBZ-D24AF-GJ4JY-JDVM2-IBYKK-KEBCU&referer=p...
<!DOCTYPE html> <html> <head> <title>捕捉和冒泡</title> <meta charset="utf-8"> </head> <bo...
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> </head> <body>...
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <script type...
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> ...