Client-side Storage
Cookiessetcookie(name,Lorem Ipsum);   document.cookie = name=Lorem Ipsum;echo $_COOKIE[name];             alert(document.c...
Sessionssession_start();$_SESSION[name] = Lorem Ipsum;echo $_SESSION[name];PHP
sessionStoragesessionStorage.setItem(name,Lorem Ipsum);alert(sessionStorage.getItem(name));JavaScript
localStoragelocalStorage.setItem(name,Lorem Ipsum);alert(localStorage.getItem(name));JavaScript
BeispielTic Tac Toe
localDatabase
openDatabasevar db = openDatabase(shortName,1.0,displayName, 10000);
create tabledb.transaction(   function(transaction){      transaction.executeSql(CREATE TABLE foobar (id, name));   })
insert intodb.transaction(   function(transaction){      transaction.executeSql(INSERT INTO foobar (id, name) VALUES ("1",...
SQLCREATE TABLE foobar (   id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,   name VARCHAR(200) NOT NULL,   description TEXT...
SQLSELECT name FROM foobarSELECT * FROM foobarSELECT * FROM foobar WHERE name == TorbenSELECT * FROM foobar WHERE name LIK...
SQLite Documentationwww.sqlite.org/lang.html
handle resultsdb.transaction(   function(transaction){      transaction.executeSql(SELECT * FROM foobar,[ ],         funct...
Referencedeveloper.apple.com/library/safari/#documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introducti...
BeispielText-Editor
BeispielSmashing Magazine Offline App
cache.manifestCACHE MANIFEST# Cache manifest version 0.2CACHE:style.cssNETWORK:*FALLBACK:images/ images/fallback.png
geschafft. danke. fragen?
Upcoming SlideShare
Loading in...5
×

Client-side Storage 

319

Published on

Intruduction to sessionStorage, localStorage &localDatabase.

Example
http://dev.augentier.info/InterfaceEntwicklung/smashing_offline/

more information
http://developer.apple.com/library/safari/#documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
319
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Client-side Storage 

  1. 1. Client-side Storage
  2. 2. Cookiessetcookie(name,Lorem Ipsum); document.cookie = name=Lorem Ipsum;echo $_COOKIE[name]; alert(document.cookie);PHP JavaScript
  3. 3. Sessionssession_start();$_SESSION[name] = Lorem Ipsum;echo $_SESSION[name];PHP
  4. 4. sessionStoragesessionStorage.setItem(name,Lorem Ipsum);alert(sessionStorage.getItem(name));JavaScript
  5. 5. localStoragelocalStorage.setItem(name,Lorem Ipsum);alert(localStorage.getItem(name));JavaScript
  6. 6. BeispielTic Tac Toe
  7. 7. localDatabase
  8. 8. openDatabasevar db = openDatabase(shortName,1.0,displayName, 10000);
  9. 9. create tabledb.transaction( function(transaction){ transaction.executeSql(CREATE TABLE foobar (id, name)); })
  10. 10. insert intodb.transaction( function(transaction){ transaction.executeSql(INSERT INTO foobar (id, name) VALUES ("1", "Maik")); })
  11. 11. SQLCREATE TABLE foobar ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(200) NOT NULL, description TEXT NOT NULL)INSERT INTO foobar ( name, description) VALUES ( Maik, Maik lebt in Berlin und ist 24 Jahre alt.)UPDATE foobar SET name = Torben WHERE name == Maik
  12. 12. SQLSELECT name FROM foobarSELECT * FROM foobarSELECT * FROM foobar WHERE name == TorbenSELECT * FROM foobar WHERE name LIKE torben ORDER BY id DESC LIMIT 5
  13. 13. SQLite Documentationwww.sqlite.org/lang.html
  14. 14. handle resultsdb.transaction( function(transaction){ transaction.executeSql(SELECT * FROM foobar,[ ], function (transaction, results){ for(var i=0; i<results.rows.length; i++){ console.log(results.rows.item(i)); } }) })
  15. 15. Referencedeveloper.apple.com/library/safari/#documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Introduction/Introduction.html
  16. 16. BeispielText-Editor
  17. 17. BeispielSmashing Magazine Offline App
  18. 18. cache.manifestCACHE MANIFEST# Cache manifest version 0.2CACHE:style.cssNETWORK:*FALLBACK:images/ images/fallback.png
  19. 19. geschafft. danke. fragen?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×