いまさらながら、localStorageを、HTML5ROCKSのClient-Side Storage試してみました。
作ってみたサンプルコートは↓
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script src="./jquery.min.js" ></script>
</head>
<body>
<script>
jQuery(function(){
$("input[name='save']").bind('click',function(){
localStorage.textdata = $("input[name='lcalStrgeVal']").val();
});
if(typeof localStorage.textdata != 'undefined'){
$("input[name='lcalStrgeVal']").val(localStorage.textdata);
}
});
</script>
<input type="text" name="lcalStrgeVal" value="">
<input type="button" value="Save" name="save">
</body>
</html> |
で、IE8とchromeで正常終了したのですが、chromeの場合は、「JavaScriptコンソール」の
「Resources」→「LocalStorage」
で確認できるのですが、IE8ではどこで確認できるのだろうか?
ちなみに、保存容量ですが、どうやらドメインごとに5MBのようです。
簡単なwebアプリを作りたい場合に便利ですね。For example, "http://abc.example.com" is allowed to store up to 5MB of Web Storage, 25MB of Web SQL Database Storage, and forbidden to use Indexed Database.
via:Quotas
0 コメント:
コメントを投稿