- 浏览: 796950 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (651)
- Java (39)
- Java 初学者小问题 (66)
- 设计模式 (7)
- 项目管理 (3)
- 数据库 (1)
- 算法 (2)
- Java practices (6)
- Effective Java2读书笔记 (78)
- Linux (2)
- programming ruby 读书笔记 (5)
- Core Java Ninth Edition Volume I 读书笔记 (15)
- Pro Git 读书笔记 (12)
- Git (3)
- Maven in Action 读书笔记 (20)
- Web (12)
- 非技术类书籍 (11)
- 电影 (40)
- Web Cache (1)
- jquery (0)
- 历史 (4)
- Dive Into HTML5 读书笔记 (13)
- 三国演义小学毕业考 (79)
- 高效能人士的7个习惯 读书笔记 (12)
- Java Performance 读书笔记 (3)
- Protocol Buffer 学习笔记 (6)
- Mongo DB 学习笔记 (7)
- Morphia 学习笔记 (7)
- Algorithms -- Princeton 学习笔记 (13)
- String研究 (10)
- Hadoop: The Definitive Guide 读书笔记 (3)
- Java与模式读书笔记 (5)
- Date研究 (3)
- The Roman Empire 听课笔记 (4)
- Algorithms -- Standford 学习笔记 (16)
- Core Java Ninth Edition Volume II 读书笔记 (9)
- Thinking in Java 4th Edition 读书笔记 (21)
- Node : Up and Running 学习笔记 (5)
- Eloquent Javascript (8)
- Smashing Node.js 读书笔记 (1)
- Algorithms II -- Standford 学习笔记 (19)
- Algorithm II -- Princeton 学习笔记 (14)
- 网络安全 (2)
- Javascript (4)
- 正则表达式 (1)
- JAVA 7/8 (15)
- JVM (10)
- NodeJS (1)
- 鸟哥的linux私房菜读书笔记 (14)
- Web Service (1)
- The art of programming (9)
- Introduction to Algorithm 读书笔记 (4)
- Java 源码阅读 (0)
- Spring in Action 读书笔记 (2)
- Java Network Programming 读书笔记 (2)
最新评论
-
心存高远:
谢谢作者分享,刚好看到这里不太明白,现在茅塞顿开。不过runt ...
关于 Maven的传递依赖的理解 -
sxlkk:
851228082 写道甚至在某次技术会议现场遇到《Maven ...
关于 Maven的传递依赖的理解 -
851228082:
851228082 写道a----compile----b-- ...
第五章 坐标和依赖 -
851228082:
a----compile----b-----provided- ...
第五章 坐标和依赖 -
851228082:
甚至在某次技术会议现场遇到《Maven in action》的 ...
关于 Maven的传递依赖的理解
1. Cookies have three potentially dealbreaking downsides:
a) C ookies are included with every HTTP request, thereby slowing down your web application by needlessly transmitting the same data over and over
b) Cookies are included with every HTTP request, thereby sending data unencrypted over the internet (unless your entire web application is served over SSL)
c) Cookies are limited to about 4 KB of data — enough to slow down your application (see above), but not enough to be terribly useful
2.
Microsoft invented DHTML
Behaviors
, and one of these behaviors was called userData
.
userData
allows web pages to store up to 64 KB of data per domain, in a
hierarchical XML-based structure. IE does not present any form of permissions
dialog, and there is no allowance for increasing the amount of storage
available.
3. In 2002, Adobe introduced “Flash cookies” in Flash 6. The feature is properly known as Local Shared Objects . Briefly, it allows Flash objects to store up to 100 KB of data per domain. By 2006, with the advent of ExternalInterface in Flash 8, accessing LSO s from JavaScript became an order of magnitude easier and faster. Brad rewrote AMASS and integrated it into the popular Dojo Toolkit under the moniker dojox.storage .
4. In 2007, Google launched Gears , an open source browser plugin aimed at providing additional capabilities in browsers. Gears provides an API to an embedded SQL database based on SQLite . After obtaining permission from the user once, Gears can store unlimited amounts of data per domain in SQL database tables. This early prototype later influenced the creation of the Web SQL Database specification. By 2009, dojox.storage could auto-detect (and provide a unified interface on top of) Adobe Flash, Gears, Adobe AIR, and an early prototype of HTML5 storage that was only implemented in older versions of Firefox.
5. HTML5 Storage is a way for web pages to store named key/value pairs locally, within the client web browser. Like cookies, this data persists even after you navigate away from the web site, close your browser tab, exit your browser, or what have you. Unlike cookies, this data is never transmitted to the remote web server (unless you go out of your way to send it manually). Unlike all previous attempts at providing persistent local storage, it is implemented natively in web browsers, so it is available even when third-party browser plugins are not.
6. You’ll access HTML5 Storage through the localStorage object on the global window object.
7. HTML5 Storage is based on named key/value pairs. The named key is a string. The data can be any type supported by JavaScript, including strings, Booleans, integers, or floats. However, the data is actually stored as a string. If you are storing and retrieving anything other than strings, you will need to use functions like parseInt() or parseFloat() to coerce your retrieved data into the expected JavaScript datatype.
interface Storage { getter any getItem(in DOMString key); setter creator void setItem(in DOMString key, in any data); };
Calling setItem() with a named key that already exists will silently overwrite the previous value. Calling getItem() with a non-existent key will return null rather than throw an exception.
8. You can treat the localStorage object as an associative array:
var foo = localStorage["bar"]; // ... localStorage["bar"] = foo;
9. There are also methods for removing the value for a given named key, and clearing the entire storage area (that is, deleting all the keys and values at once).
interface Storage { deleter void removeItem(in DOMString key); void clear(); };
10. There is a property to get the total number of values in the storage area, and to iterate through all of the keys by index (to get the name of each key).
If you call key() with an index that is not between 0–(length-1), the function will return null .
interface Storage { readonly attribute unsigned long length; getter DOMString key(in unsigned long index); };
11. The storage event is fired on the window object whenever setItem() , removeItem() , or clear() is called and actually changes something. If you set an item to its existing value or call clear() when there are no named keys, the storage event will not fire, because nothing actually changed in the storage area:
if (window.addEventListener) { window.addEventListener("storage", handle_storage, false); } else { window.attachEvent("onstorage", handle_storage); };
The handle_storage callback function will be called with a StorageEvent object, except in Internet Explorer where the event object is stored in window.event .
function handle_storage(e) { if (!e) { e = window.event; } }
12. A StorageEvent object, which has the following useful properties:
The
storage
event is not cancelable. It’s simply a way for the browser to tell you, “hey,
this just happened. There’s nothing you can do about it now; I just wanted to
let you know.”
13. By default, the storage space is 5 megabytes across browsers, although it is phrased as no more than a suggestion in the HTML5 Storage specification. One thing to keep in mind is that you’re storing strings, not data in its original format. If you exceed your storage quota of 5 megabytes, you will get a “QUOTA_EXCEEDED_ERR ” exception. No browser supports any mechanism for web developers to request more storage space, although it can be a user-initiated action to control the storage space for some browsers.
14. Another competing vision for advanced, persistent, local storage for web applications: the Indexed Database API , formerly known as “WebSimpleDB,” now affectionately known as “IndexedDB.” An early walk-through of IndexedDB is a good tutorial of how IndexedDB works, giving side-by-side comparisons of IndexedDB and Web SQL Database.
发表评论
-
《Dive into HTML5》 读后感
2012-06-20 07:57 1516读这本书的起因是参加了2012年的Qcon,对其中某个 ... -
Manipulating History for Fun & Profit
2012-06-20 07:29 10591. The HTML5 history AP ... -
“Distributed,”“Extensibility,”& Other Fancy Words
2012-06-15 15:54 8971. Microdata annotates t ... -
A Form of Madness
2012-06-11 10:41 9721. Placeholder text is d ... -
Let’s Take This Offline
2012-06-09 23:32 9401. An offline web app ... -
You Are Here (And So Is Everybody Else)
2012-06-09 16:06 11181. Geolocation is the ar ... -
Video in a Flash (Without That Other Thing)
2012-06-08 15:46 11241. HTML5 defines a standard wa ... -
Let’s Call It A Draw(ing Surface)
2012-06-06 17:19 11931. HTML 5 defines the &l ... -
What Does It All Mean?
2012-06-03 19:23 10871. In Activating Browse ... -
Detecting HTML5 Features
2012-05-24 19:05 10791. There are four basic ... -
A Quite Biased History of HTML5
2012-05-23 20:02 10881. “content type” or “MIM ... -
Introduction: Five Things You Should Know About HTML5
2012-05-22 15:23 10141. HTML5 is a collectio ...
相关推荐
having a place to store all their stuff. Not so in JavaScript. You simply don’t have the luxury of walk-in closets and three-car garages. In JavaScript, everything has its place, and it’s your job ...
winhole.zip This example demonstrates how to put a hole in the center of a form.<END><br>15 , tileform.zip This will tile a picture on the background of your form.<END><br>16 , radiomnu.zip ...
- Note: We have seen a report of the Video Playback failing (crash) due to a faulty video codec, ffdshow.ax. If you are using this we suggest you try a different Video file and codec. Release ...
querys and fields of a database and put them in a TreeView(using OpenSchema ADOConnection method)<END><br>7 , imagechunk1.zip This application will save JPG,BMP,GIF files in your database and ...
Some stupid mail servers put tabs in some fields (CC:, TO:) when they want to make a new line, the correct is to put at least a space in the beginning of the line, added a little code to "...
When you include a header file you introduce a dependency that will cause your code to be recompiled whenever the header file changes. If your header file includes other header files, any change to ...
Source code + tutorial.<END><br>26 , chat.zip This code shows you how to creat a local network chat room so that you and your friends can have a chat room which nowone else can enter<END><br>27 , ...
Stuff at Your Disposal ■Chapter 2: Projects and Targets Pieces and Parts Creating a Project Project Structure Root Contents The Sweat Off Your Brow And Now, the Rest of the Story What You Get Out...
Adding a New Item to your Window Menu Two Views Automatically Changing Views in an SDI Application How MFC Reacts to Multiple Templates What Frames are For Status Bars and Toolbars CStatusBar ...
+ DMA mode on AK2 (Hold A while loading a game to use non-DMA mode: Red text = DMA / Blue text = non-DMA). + New Super Mario Brothers Minigames on AK2: If they don't work, set Download Play to ...