Today, when Internet connections are ubiquitous, we suddenly have another need, offline Web. Excellent web applications such as Gmail, Google Reader, and Zoho all support offline use, thanks to Google Gears. However, the real offline Web depends on HTML 5. This future Web language star will develop a set of standards for offline storage of the Web. W3C has released HTML5 offline storage details.
Some 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.
However, 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.
International source of this article: http://www.webmonkey.com/blog/Why_JavaScript_Will_Save_Offline_Storage_in_HTML_5
Chinese translation source: COMSHARP CMS official website
35 kilometers