为什么连接sqlite DB(物理文件)的javascript代码不起作用

为什么连接sqlite DB(物理文件)的javascript代码不起作用,javascript,sqlite,Javascript,Sqlite,我的Javascript代码如下 <html> <head> <title>Page Title</title> </head> <script> var db = openDatabase('test', '1.0', 'my first database', 2 * 1024 * 1024); db.transaction(function (tx) { tx.executeSql('CREATE TABLE IF NO

我的Javascript代码如下

<html>
<head>
<title>Page Title</title>
</head>
<script>
var db = openDatabase('test', '1.0', 'my first database', 2 * 1024 * 1024);
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS foo (id unique, text)');
tx.executeSql('INSERT INTO foo (id, text) VALUES (1, "synergies")');
});
</script>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

页面标题
var db=openDatabase('test','1.0','myfirst database',2*1024*1024);
数据库事务(功能(tx){
tx.executeSql('CREATE TABLE IF NOT EXISTS foo(id unique,text));
tx.executeSql('插入到foo(id,文本)值中(1,“协同效应”));
});
我的第一个标题
我的第一段


我从web上了解到sql数据库应该在
crome
中工作。但这是行不通的

您得到了什么错误?crome控制台中没有错误。什么不起作用?因此它应该在sqlite db中创建一个名为
test
的新表
foo
。但事实并非如此happening@Fast我现在得到了它,它创建了一个名为
test
的web sql数据库和一个名为
foo
的表。我的想法是它将读取我的test.dbsqlite,并在同一个物理db文件上执行事务