简体   繁体   English

如何使用javascript保存到sqlite数据库?

[英]How do I save to a sqlite database using javascript?

I am developing a webpage for offline CRUD for a sqlite database using sqlite. 我正在为使用sqlite的sqlite数据库开发脱机CRUD的网页。 I have little experience with javascript, none with jquery, and a little with sqlite but none with developing it within javascript. 我对javascript的经验很少,对jquery的经验很少,对sqlite的经验很少,但是在javascript中开发它却没有经验。 I began using this tutorial here 我从这里开始使用本教程

I noticed however that the data doesn't seem to be writing to the database itself and is browser dependent. 但是我注意到,数据似乎并没有写入数据库本身,而是依赖于浏览器。 If I open it with Chrome it only remembers the data from previous sessions in chrome and if I open it with opera it only reads the data from other sessions in opera. 如果我使用Chrome打开它,它只会记住chrome中以前的会话中的数据,如果我用Opera打开它,则只能读取Opera中其他会话中的数据。 When I inspect the database file I don't see data being saved to it. 当我检查数据库文件时,没有看到数据被保存到该文件中。

Are there separate databases running in the background of the actual browsers themselves or is this tutorial not saving the data to the database itself? 在实际浏览器本身的后台是否运行着单独的数据库,或者本教程是否未将数据保存到数据库本身? If it is not saving to the database then how do I save using javascript? 如果未保存到数据库,那么如何使用javascript保存?

Thank you! 谢谢!

HTML5 has sqlite database. HTML5具有sqlite数据库。

So.. each browser implements this using w3c standard .. This has nothing to do with any local database server. 因此..每个浏览器都使用w3c standard实现此目标。与任何本地数据库服务器无关。 Sqlite is an embeded database... Sqlite是一个嵌入式数据库...

So.. yes, it is browser dependent... 所以..是的,这取决于浏览器...

An example for you: you can compare sqlite to cookies but cooler :) 一个适合您的示例:您可以将sqlitecookies进行比较,但比较sqlite :)

The data is stored in a file but you'll need to use procmon or a file system watcher to find out where. 数据存储在文件中,但是您需要使用procmon或文件系统监视程序来查找位置。 For FF it's near where cookies and cache files are saved if I remember correctly. 对于FF,如果我没有记错的话,它就在保存Cookie和缓存文件的位置附近。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM