Some people may say that the offline Web is meaningless . All you get is a crappy desktop program. In today's era of ubiquitous wi-fi and 3G, we are online most of the time. This is true, but among us The offline Web is very important to those who have become indispensable to various Web applications such as email, online news and Twitter.
But there are always problems. HTML5 Web storage details involve very complex issues, SQLite . Those who need to write offline web programs need to write SQL code. There is nothing wrong with SQLite, but it is a variant of SQL and has some differences from standard SQL. In addition, SQLite does not belong to the W3C, and its owner is likely to change it someday. interface, which will cause those Web programs that have already been written to have to be rewritten.
Is there a better way? Mozilla Labs' Atul Varma recently published a blog post offering an alternative . Varma is working on an experimental version of CouchDB that implements the database's semantics in JavaScript in the browser. Eventually, we may be able to implement database queries directly using JavaScript, eliminating the problems of HTML5 in this area.
In response to this article, Mark Finkle of the Mozilla Fennec mobile browser team said in the comments that this solution avoids the more important issues in the standard database backend. It is best to make localStorage/globalStorage the standard and keep the standard at the bottom. He said in his own pointed out in a blog post that a JavaScript library should be established. Just like many existing JavaScript libraries can operate web page elements, there should also be a JavaScript library used to operate offline Web storage data.
This approach may seem complex on the surface, but it will bring flexibility to developers, and our opportunities will be greater when the Web is omnipotent.
Further reading