I have a requirement where I have a postgresql database in a web site. I want to run my web site in offline mode but the problem is that I have many ajax calls in my website which will not work in offline mode.
So I am considering using sqlLite but I don't know how to configure it, how to write JavaScript code, or even know if the users need to install sqlite in their browser or PC. Can anyone help to overcome this requirement?
I have used some local storage like Indexed DB it will work but that is called sqlLite or not I don't know.
please help
答案 0 :(得分:1)
You do not need to work with Sqlite for addressing this, only take a look at following link for how to make web pages available for offline viewing.
答案 1 :(得分:1)
如果您想使用某个数据库,可以使用SQLite。
查看https://github.com/kripken/sql.js/
注意在主UI线程中使用SQLite请求。不要忘记为SQLite实现worker。
答案 2 :(得分:0)
I'm pretty sure that you do not need SQLite. Try using HTML5 LocalStorage API. https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
The Storage interface of the Web Storage API provides access to the session storage or local storage for a particular domain, allowing you to for example add, modify or delete stored data items. If you want to manipulate the session storage for a domain, you call Window.sessionStorage method; If you want to manipulate the local storage for a domain, you call Window.localStorage.