ݺߣ

ݺߣShare a Scribd company logo
ܧѧݧߧ ѧߧڧݧڧ
ڧ: MicroSoft Internet Explorer.? UserData object.? 64Kb per domain (x10 for trusted domains) Adobe Local Storage Objects AMASS (AJAX MAssive Storage System) Later AMASS->Dojo Toolkit (dojo.storage) Google.Gears (plugin, permissions)
HTML5 Storage ? (DOM Storage, Web Storage, Local Storage) - ѧߧ֧ߧڧ էѧߧߧ key -> value - էѧߧߧ ߧ ֧֧էѧ ߧ ֧ӧ֧ - ӧ֧ߧ  ҧѧ٧֧, ߧ ߧاߧ ҧڧҧݧڧ֧, ݧѧԧڧߧ... - 5 ( IE - 10Mb)  8.0 3.5 4.0 4.0 10.5
 էѧߧߧ ѧߧ ܧѧ ܧ ݧ٧ӧѧ ParseInt() & ParseFloat() window.localStorage vs. winsdow.sessionStorage - getItem() - setItem() - removeItem() localStorage['a'] && localStorage.a localStorage.key() localStorage.clear() localStorage.length IE : localStorage.remainingSpace
Web SQL DB - SQLite (SQL syntax) - SELECT, UPDATE, INSERT, DELETE... - - 4.0 4.0 10.5
dbh = openDatabase( "MyDB" ,  "1.0.0" ,  "My Database" , 1048576); dbh.transaction(function(tx) {? ?  tx.executeSql( ???  ' CREATE TABLE table01 (id INTEGER PRIMARY KEY, name TEXT) ', ???  [],? //params? ???  function(tx, rs){}, //result handler? ???  function(tx, er){} //error handler? ?  ); });
dbh.transaction(function(tx) {? ?  tx.executeSql( ???  ' INSERT INTO TABLE table01 (id, name) VALUES (?, ?) ', ???  [i, name], ???  function(tx, rs){}, ???  function(tx, er){} ?  ); });
dbh.transaction(function(tx) { ?  tx.executeSql( ???  ' SELECT * FROM table01 WHERE name = ? ',?? ???  [name],?? ???  function(tx, rs){},? ???  function(tx, er){} ?  ); });
SQLResultSet ?  insertId :? Error: ... (SELECT QUERY) ? ?  rows :?SQLResultSetRowList ? ? ?  length :? 1 ? ? ?  __proto__ :?SQLResultSetRowList ? ? ? ?  constructor :?function SQLResultSetRowList()... ? ? ? ?  item :?function item() ... ? ?? ? ??  arguments :? null ? ???????  caller :? null ? ???????  length :? 0 ? ???????  name :? "item" ? ???????  prototype :?item ? ???????  __proto__ :?function Empty() {} ? ?????  __proto__ :?Object ? ???  rowsAffected :? 1 ? ?  __proto__ :?SQLResultSet SQLError ? code :? 5 ? message :? "no such table: table01" ? __proto__ :?SQLError
IndexedDB IE9 ? 4.0 - 8.0 -
֧ ڧ ѧߧ٧ѧܧڧ:? READ_ONLY READ_WRITE SNAPSHOT_READ VERSION_CHANGED
idb = window.mozIndexedDB || window.webkitIndexedDB || null; ? //new ActiveXObject("SQLCE.Factory.4.0"); //new ActiveXObject("SQLCE.FactorySync.4.0"); var request = window.indexedDB.open("DatabaseName", "DatabaseDescription"); ? request.onsuccess = function(event){ ?  var database = event.result; ?  write("Database Opened", database); }; ? request.onerror = function(e){ ?  writeError(e); };
WebDatabase ? var  kids  =   [ ?  {   name :   &quot;Anna&quot;   } , ? ?  {   name :   &quot;Betty&quot;   } , ?  {   name :   &quot;Christine&quot;   } ? ] ; ? var  db  =  window. openDatabase ( &quot;CandyDB&quot; ,   &quot;1&quot; ,   &quot;My candy store database&quot; ,   1024 ) ; ? ? db. transaction ( function ( tx )   { ?  for   ( var  index  =   0 ;  index  <  kids. length ;  index ++ )   { ???  var  kid  =  kids [ index ] ; ? ???  tx. executeSql ( ? ?????  &quot;INSERT INTO kids (name) VALUES (?);&quot; ,   ? ?????  [ kid ] , ? ?????  function ( tx ,  results )   { ? ???????  alert( &quot;Saved record for &quot;   +  kid. name   +   &quot; with id &quot;   +  results. insertId ); ? ? ?  } ???  ) ; ?  } }) ;
IndexedDB ? var  kids  =   [ ? ?  {   name :   &quot;Anna&quot;   } ,   ? ?  {   name :   &quot;Betty&quot;   } ,   ? ?  {   name :   &quot;Christine&quot;   }   ? ] ; ? ? var  request  =  window. indexedDB . open ( &quot;CandyDB&quot; ,   &quot;My candy store database&quot; ) ; ? ? request. onsuccess   =   function ( event )   { ?  var  objectStore  =  event. result . objectStore ( &quot;kids&quot; ) ; ? ?  for   ( var  index  =   0 ;  index  <  kids. length ;  index ++ )   { ? ???  var  kid  =  kids [ index ] ; ? ???  objectStore. add ( kid ) . onsuccess   =   function ( event )   { ? ?????  alert( &quot;Saved record for &quot;   +  kid. name   +   &quot; with id &quot;   +  event. result );   ? ???  } ;   ? ?  } ? } ;
ڧѧ: http://dev.w3.org/html5/webstorage/ http://msdn.microsoft.com/en-us/library/cc197062%28VS.85%29.aspx http://htmlbook.ru/html5/storage / http://diveintohtml5.org/storage.html http://dev.w3.org/html5/webdatabase/ http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/  http://mikewest.org/2010/12/intro-to-indexeddb http://habrahabr.ru/blogs/webdev/117473/ http://msdn.microsoft.com/en-us/scriptjunkie/gg679063 ?

More Related Content

What's hot (20)

Sis quiz
Sis quizSis quiz
Sis quiz
Clesio Veloso
?
dojo.basix
dojo.basixdojo.basix
dojo.basix
wolframkriesing
?
2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach
Johannes Hoppe
?
ߧڧ ֧ڧӧѧߧڧ Zend Framework 2.0
ߧڧ ֧ڧӧѧߧڧ  Zend Framework 2.0ߧڧ ֧ڧӧѧߧڧ  Zend Framework 2.0
ߧڧ ֧ڧӧѧߧڧ Zend Framework 2.0
zfconfua
?
Javantura Zagreb 2014 - Groovy-SQL - Dinko Srko?
Javantura Zagreb 2014 - Groovy-SQL - Dinko Srko?Javantura Zagreb 2014 - Groovy-SQL - Dinko Srko?
Javantura Zagreb 2014 - Groovy-SQL - Dinko Srko?
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
?
ղѳ5ʹä֥ץꥱ`θٻ
ղѳ5ʹä֥ץꥱ`θٻղѳ5ʹä֥ץꥱ`θٻ
ղѳ5ʹä֥ץꥱ`θٻ
hagino 3000
?
jQuery sans jQuery
jQuery sans jQueryjQuery sans jQuery
jQuery sans jQuery
goldoraf
?
Documentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizDocumentacion edderson callpa_ortiz
Documentacion edderson callpa_ortiz
Edderson J. Ortiz
?
aggregation and indexing with suitable example using MongoDB.
aggregation and indexing with suitable example using MongoDB.aggregation and indexing with suitable example using MongoDB.
aggregation and indexing with suitable example using MongoDB.
bhavesh lande
?
Php codigos interfaces fredy guzman cusihunca
Php codigos interfaces   fredy guzman cusihuncaPhp codigos interfaces   fredy guzman cusihunca
Php codigos interfaces fredy guzman cusihunca
Tigger_Fred
?
KvZ Web Tasar?m Hizmetleri
KvZ Web Tasar?m HizmetleriKvZ Web Tasar?m Hizmetleri
KvZ Web Tasar?m Hizmetleri
Ahmet ?zta?
?
Sumahex
SumahexSumahex
Sumahex
jbersosa
?
Miniray.php
Miniray.phpMiniray.php
Miniray.php
maeeeng69
?
Feeds. ڧݧ٧ӧѧߧڧ ٧էѧߧڧ ݧѧԧڧߧ. Feeds API
Feeds. ڧݧ٧ӧѧߧڧ  ٧էѧߧڧ ݧѧԧڧߧ. Feeds APIFeeds. ڧݧ٧ӧѧߧڧ  ٧էѧߧڧ ݧѧԧڧߧ. Feeds API
Feeds. ڧݧ٧ӧѧߧڧ ٧էѧߧڧ ݧѧԧڧߧ. Feeds API
Alex S
?
Introduccin a Bolt
Introduccin a BoltIntroduccin a Bolt
Introduccin a Bolt
Asier Marqus
?
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Arulmurugan Rajaraman
?

Local storages

  • 2. ڧ: MicroSoft Internet Explorer.? UserData object.? 64Kb per domain (x10 for trusted domains) Adobe Local Storage Objects AMASS (AJAX MAssive Storage System) Later AMASS->Dojo Toolkit (dojo.storage) Google.Gears (plugin, permissions)
  • 3. HTML5 Storage ? (DOM Storage, Web Storage, Local Storage) - ѧߧ֧ߧڧ էѧߧߧ key -> value - էѧߧߧ ߧ ֧֧էѧ ߧ ֧ӧ֧ - ӧ֧ߧ ҧѧ٧֧, ߧ ߧاߧ ҧڧҧݧڧ֧, ݧѧԧڧߧ... - 5 ( IE - 10Mb) 8.0 3.5 4.0 4.0 10.5
  • 4. էѧߧߧ ѧߧ ܧѧ ܧ ݧ٧ӧѧ ParseInt() & ParseFloat() window.localStorage vs. winsdow.sessionStorage - getItem() - setItem() - removeItem() localStorage['a'] && localStorage.a localStorage.key() localStorage.clear() localStorage.length IE : localStorage.remainingSpace
  • 5. Web SQL DB - SQLite (SQL syntax) - SELECT, UPDATE, INSERT, DELETE... - - 4.0 4.0 10.5
  • 6. dbh = openDatabase( &quot;MyDB&quot; , &quot;1.0.0&quot; , &quot;My Database&quot; , 1048576); dbh.transaction(function(tx) {? ? tx.executeSql( ??? ' CREATE TABLE table01 (id INTEGER PRIMARY KEY, name TEXT) ', ??? [],? //params? ??? function(tx, rs){}, //result handler? ??? function(tx, er){} //error handler? ? ); });
  • 7. dbh.transaction(function(tx) {? ? tx.executeSql( ??? ' INSERT INTO TABLE table01 (id, name) VALUES (?, ?) ', ??? [i, name], ??? function(tx, rs){}, ??? function(tx, er){} ? ); });
  • 8. dbh.transaction(function(tx) { ? tx.executeSql( ??? ' SELECT * FROM table01 WHERE name = ? ',?? ??? [name],?? ??? function(tx, rs){},? ??? function(tx, er){} ? ); });
  • 9. SQLResultSet ? insertId :? Error: ... (SELECT QUERY) ? ? rows :?SQLResultSetRowList ? ? ? length :? 1 ? ? ? __proto__ :?SQLResultSetRowList ? ? ? ? constructor :?function SQLResultSetRowList()... ? ? ? ? item :?function item() ... ? ?? ? ?? arguments :? null ? ??????? caller :? null ? ??????? length :? 0 ? ??????? name :? &quot;item&quot; ? ??????? prototype :?item ? ??????? __proto__ :?function Empty() {} ? ????? __proto__ :?Object ? ??? rowsAffected :? 1 ? ? __proto__ :?SQLResultSet SQLError ? code :? 5 ? message :? &quot;no such table: table01&quot; ? __proto__ :?SQLError
  • 10. IndexedDB IE9 ? 4.0 - 8.0 -
  • 11. ֧ ڧ ѧߧ٧ѧܧڧ:? READ_ONLY READ_WRITE SNAPSHOT_READ VERSION_CHANGED
  • 12. idb = window.mozIndexedDB || window.webkitIndexedDB || null; ? //new ActiveXObject(&quot;SQLCE.Factory.4.0&quot;); //new ActiveXObject(&quot;SQLCE.FactorySync.4.0&quot;); var request = window.indexedDB.open(&quot;DatabaseName&quot;, &quot;DatabaseDescription&quot;); ? request.onsuccess = function(event){ ? var database = event.result; ? write(&quot;Database Opened&quot;, database); }; ? request.onerror = function(e){ ? writeError(e); };
  • 13. WebDatabase ? var kids = [ ? { name : &quot;Anna&quot; } , ? ? { name : &quot;Betty&quot; } , ? { name : &quot;Christine&quot; } ? ] ; ? var db = window. openDatabase ( &quot;CandyDB&quot; , &quot;1&quot; , &quot;My candy store database&quot; , 1024 ) ; ? ? db. transaction ( function ( tx ) { ? for ( var index = 0 ; index < kids. length ; index ++ ) { ??? var kid = kids [ index ] ; ? ??? tx. executeSql ( ? ????? &quot;INSERT INTO kids (name) VALUES (?);&quot; , ? ????? [ kid ] , ? ????? function ( tx , results ) { ? ??????? alert( &quot;Saved record for &quot; + kid. name + &quot; with id &quot; + results. insertId ); ? ? ? } ??? ) ; ? } }) ;
  • 14. IndexedDB ? var kids = [ ? ? { name : &quot;Anna&quot; } , ? ? { name : &quot;Betty&quot; } , ? ? { name : &quot;Christine&quot; } ? ] ; ? ? var request = window. indexedDB . open ( &quot;CandyDB&quot; , &quot;My candy store database&quot; ) ; ? ? request. onsuccess = function ( event ) { ? var objectStore = event. result . objectStore ( &quot;kids&quot; ) ; ? ? for ( var index = 0 ; index < kids. length ; index ++ ) { ? ??? var kid = kids [ index ] ; ? ??? objectStore. add ( kid ) . onsuccess = function ( event ) { ? ????? alert( &quot;Saved record for &quot; + kid. name + &quot; with id &quot; + event. result ); ? ??? } ; ? ? } ? } ;
  • 15. ڧѧ: http://dev.w3.org/html5/webstorage/ http://msdn.microsoft.com/en-us/library/cc197062%28VS.85%29.aspx http://htmlbook.ru/html5/storage / http://diveintohtml5.org/storage.html http://dev.w3.org/html5/webdatabase/ http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/ http://mikewest.org/2010/12/intro-to-indexeddb http://habrahabr.ru/blogs/webdev/117473/ http://msdn.microsoft.com/en-us/scriptjunkie/gg679063 ?