我有一组HTML文件和一个SQLite数据库,我想使用file://方案从浏览器访问它们.可以使用JavaScript访问数据库并创建查询(和表)吗?
我有一组HTML文件和一个SQLite数据库,我想使用file://方案从浏览器访问它们.可以使用JavaScript访问数据库并创建查询(和表)吗?
事实上,答案是肯定的.下面是一个如何做到这一点的示例:http://html5doctor.com/introducing-web-sql-databases/
不好的是,浏览器对它的支持非常有限.
更多信息请点击这里HTML5 IndexedDB, Web SQL Database and browser wars
注:正如@Christoph所说的Web SQL is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further,看这里https://developer.mozilla.org/en-US/docs/IndexedDB.
EDIT个
正如@clentfort所说,您可以使用SQL.js通过客户端JavaScript访问SQLite数据库.