CS2550 Dr. Brian Durney. SOURCES  JavaScript: The Definitive Guide, by David Flanagan  Dive into HTML5, by Mark Pilgrim

Slides:



Advertisements
Similar presentations
HTML5 Overview Owen Williams owen at dynabooks daht com Owen Williams owen at dynabooks daht com.
Advertisements

CSN11121 System Administration and Forensics Web Browser Forensic
For Details Visit : or For any Help Contact the Librarian EBSCOhost 2.0.
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
HTTP Request/Response Process 1.Enter URL ( in your browser’s address bar. 2.Your browser uses DNS to look up IP address of server.com.
In-browser storage and me Jason Casden North Carolina State University Libraries Code4Lib 2012.
HTML5 Storage. Why Local Storage? Data accessed over the internet can never be as fast as accessing data locally Data accessed over internet not secure.
More CSS - Page layout + HTML5 new features Boriana Koleva Room: C54
HTML5 Applications with ASP.NET Web Forms Stephen Walther Superexpert.com
Internet Browser History Presented by K. SURESH sureshsrikalahasti.weebly.com
 data/data-storage.html#pref data/data-storage.html#pref 
PGN5: KAING, RISHER AND SCHULTE PERSISTENT COOKIES WITH BROWSER FINGERPRINTING.
HTML5 JavaScript Storage for Structured Data Andy Gup, Esri
Web Storage IDIA 619 Spring 2013 Bridget M. Blodgett.
Browser Comparisons - Convenience Internet Explorer 8 & 9, Chrome 11 and Firefox 4 Searching, Convenience & Add-ons.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
Chapter 25 Utilizing Web Storage.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
Martin Kruliš by Martin Kruliš (v1.0)1.
HTML Essentials Frames and Frame Tags. Introduction A frame used to be an effective design tool Utilized space effectively by subdividing screen One idea:
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
Ajax Application Errors Developer Oversight and Tracking Errors Presented by Eric Pascarello.
Mobile App Support Jacob Poirier Geri Hengesbach Andrea Menke Erin Rossell.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Web Application Programming Carol Wolf Computer Science.
JavaScript, Fourth Edition
WaveMaker Visual AJAX Studio 4.0 Training Installation.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
HTML5. HTML5’s overall theme The browser as a rich application platform rich, cross-device user interfaces offline operation capability hardware access.
Chapter 8 Cookies And Security JavaScript, Third Edition.
CHAP 6. USING THE HTML5 WEB STORAGE API.  Cookie - Are a built-in way of sending text values back and forth from server to client.  Servers can use.
MediMizer User Group  Users want an iPad application  Users want a web application  IT wants a no-installation client  Can be used anywhere.
Cookies Web Browser and Server use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website it is required to maintain.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
JavaScript Part 9 George Mason University June 23, 2010.
1 3 Computing System Fundamentals 3.4 Networked Computer Systems.
Internet & World Wide Web How to Program, 5/e. 2.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Browser Wars (Click on the logo to see the performance)
HTML 5 Tutorial Chapter 6 Web Storage. Storing Data on The Client HTML5 offers two new objects for storing data on the client: localStorage - stores data.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Rich Internet Applications 9. HTML 5 and RIAs. HTML 5 Standard currently under development by W3C Aims to improve the language with support for the latest.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
Internet Searching the World Wide Web. The Internet and the World Wide Web The Internet is a worldwide collection of networks that allows people to communicate.
CHAPTER 9 File Storage Shared Preferences SQLite.
Using HTML5 to Build Offline Applications Woody Pewitt Icenium
Phonegap Bridge – Storage CIS 136 Building Mobile Apps 1.
Web Storage and Cookies Cookies, Local and Session Storage SoftUni Team Technical Trainers Software University
Development of Internet Applications HTML5 Ing. Jan Janoušek 7.
Storing Data.
JavaScript, Sixth Edition
COP4710 Database Systems Project Overview.
HTML 5 Tag By: Raul, Cordero.
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
CIS 136 Building Mobile Apps
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
WEB PROGRAMMING JavaScript.
03 | Building a Backend with Socket.IO and Mongo
CIS 136 Building Mobile Apps
HTML5 and Local Storage.
CS4433 Database Systems Project.
HTML5 and Local Storage.
Business Zone - Clearing your Cache
Presentation transcript:

CS2550 Dr. Brian Durney

SOURCES  JavaScript: The Definitive Guide, by David Flanagan  Dive into HTML5, by Mark Pilgrim

BEFORE HTML5 WEB STORAGE  Cookies – sent to server possibly unencrypted, only 4K data  Internet Explorer – userData  Flash – Local Shared Objects  Dojo Toolkit – dojox.storage  Google Gears Except for cookies, all of these rely on third- party plugins or are only available in one browser. (Cookies have their own issues.)

WEB STORAGE  Maps string keys to string values  Can store “large (but not huge) amounts of data” Provides persistent storage for web applications tictactoe.co m Tic Tac Toe George Won: 3 Lost: 10 "playerName": "George" "won": "3" "lost": "10" David Flanagan, JavaScript: The Definitive Guide p. 587

tictactoe.co m Tic Tac Toe George Won: 3 Lost: 10 PERSISTENT STORAGE tictactoe.co m Tic Tac Toe George Won: 3 Lost: 10 Web app saves data in local storage User quits browserUser returns to site in same browser tictactoe.co m Tic Tac Toe George Won: 3 Lost: 10 "playerName": "George" "won": "3" "lost": "10" "playerName": "George" "won": "3" "lost": "10"

BROWSER SUPPORT caniuse.com screen capture from 20OCT15 Web storage is supported by (virtually) all current browsers and a lot of older browsers.

USING LOCAL STORAGE LIKE AN OBJECT "playerName": "George" "won": "3" "lost": "10" localStorage.playerName = "George"; localStorage['won'] = 3; localStorage.lost = 10; WRITE var name = localStorage.playerName; alert(name); // ALERTS George READ

USING THE Storage API "playerName": "George" "won": "3" "lost": "10" localStorage.setItem("playerName", "George"); localStorage.setItem("won", 3); localStorage.setItem("lost", 10); var name = localStorage.getItem("playerName"); alert(name); // ALERTS George READ WRITE

USING THE Storage API "playerName": "George" "won": "3” localStorage.removeItem("lost"); localStorage.clear(); alert(localStorage.length); // ALERTS 0 CLEAR DELETE Remove all keys and values Remove specified key and associated value Nothing left in the storage object

OBJECTS AND ARRAYS var recordObj = {"lost": 10, "won": 3}; var recObjStr = JSON.stringify(recordObj); localStorage.record = recObjStr; Use JSON.parse to convert a string to an object or array. Use JSON.stringify to convert an object or array to a string. Objects and arrays can’t be stored directly in local storage. var recObjStr = localStorage.record; var recordObj = JSON.parse(recObjStr);

localStorage AND sessionStorage  LIFETIME: permanent (until deleted)  SCOPE: Document origin  LIFETIME: Until window or tab is closed  SCOPE: document origin, per window

HOW MUCH DATA? “5 megabytes” is how much storage space each origin gets by default. This is surprisingly consistent across browsers, although it is phrased as no more than a suggestion in the HTML5 Storage specification. --Mark Pilgrim 5 MB

BEYOND NAMED KEY-VALUE PAIRS  Web SQL Database  IndexedDB But there is more to life than “5 megabytes of named key/value pairs,” and the future of persistent local storage is… how shall I put it… well, there are competing visions. --Mark Pilgrim

WEB SQL DATABASE  Uses embedded SQLite database  Provides an executeSql method While Web SQL Database is supported in Chrome, Safari & Opera, Firefox and IE are unlikely to support it any time soon (Mozilla is philosophically opposed).

INDEXED DATABASE  Provides an object store  Database, records, fields, cursor, transactions  No structured query language—use object store methods instead Indexed Database has an early implementation in Firefox 4.0 Beta and Chrome dev channel. There's a good chance all browsers will support it in the future, but that's not yet clear.