html5用户指南

  1. 结构化元素
  2. contentEditable=true 让文档可编辑document.designMode='on'
  3. 将文本设为粗体 document.execCommand('bold')

  4. placeholder autofocus autocomplete multiple required parttern

  5. 判断属性 'autofocus' in document.createElement('input')
  6. 数据存储 sessionStorage创建的数据只有在那些窗口可用,知道窗口关闭,localStorage是基于域的,可跨域在打开的所有窗口.getItem方法返回的数据为字符串,所以如果存储一个对象,实际是[Object Object],可通过JSON.parse(obj)处理
  7. 遍历存储对象for(var i=0;i
  8. 删除数据 sessionstorage.removeItem(key)
  9. websql数据库 默认为sqllite
    打开创建数据var db =opendatebase('mydb','1.0','my database','10*1024*1024')
  10. 创建表需要在事物中执行var db;if(window.openDatabase){ db=opendatebase('mydb','1.0','my database','10*1024*1024'); db.transaction(function(tx){ tx.executesql('create table is not exists sf(id,date,text)'); tx.executesql('insert into sf (id,date,text) values(?,?,?),[2,2014,"test"]') }) }
    14.geolation
    if(nabigator.geolocation){ navigator.geolocation.getcurrentPostion(function(position){ var coords=position.coords; showMap(coords.latitude,coords.longitude,coords.accuracy) }) }

http://levi.cg.am/archives/1920
http://www.feeldesignstudio.com/2011/01/html5-tutorial-1

你可能感兴趣的:(html5)