Home > Web Front-end > H5 Tutorial > body text

Webkit做到了HTML5方式的客户端数据库存储

WBOY
Release: 2016-05-17 09:09:47
Original
1165 people have browsed it

HTML5的发展得如火如荼,各位技术人员都在深入的研究和试图掌握此项技术,Webkit就做到了HTML5方式的客户端数据库存储。且先看下Webkit是如何实现的吧!

目前正在规划的HTML5标准中有很多令人兴奋的特性,我们非常愿意将这些特性在Webkit里加以实现。其中有一个特性,我们觉得目前可以带给浏览器足够的惊喜——这甚至还并不是规范,那就是客户端数据库存储。因此最近几周我和andersca还有xenon已经将其实现!

客户端数据库存储接口允许网页应用通过SQL——这个很多Web开发者已经熟悉的媒介,存储结构化的本地数据。

这些接口是异步的并且使用回调函数来处理数据库查询的结果。
定义一个简单用途的回调函数大概是如下的样子:

var database = openDatabase("Database Name", "Database Version");  
 
database.executeSql("SELECT * FROM test", function(result1) {  
   // do something with the results  
   database.executeSql("DROP TABLE test", function(result2) {  
     // do some more stuff  
     alert("My second database query finished executing!");  
   });  
});  

这里还有如何在一个真实的情境中使用这些接口的例子 ,我们将尝试不断记录事情的发展。

这个初步的功能实现有一些已知的和规范不符的缺陷。不过这个是基础,同时也是为了人们真正把这个特性用起来而探索接下来工作需求的最好方式!

Related labels:
ht
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!