(function(scripts, callback, errorback) {
if (typeof errorback != 'function')
errorback = function(url) { alert('jsloader load error: ' + url) };
var cssRegexp = /.css$/;
var load = function(url) {
if (cssRegexp.test(url)) {
var link = document.createElement('link');
link.href = url;
link.type = 'text/css';
link.rel = 'stylesheet';
(document.getElementsByTagName('head')[0] || document.body).appendChild(link);
if (scripts.length) {
load(scripts.shift());
} else {
callback();
}
} else {
var script = document.createElement('script');
script.type = 'text/javascript';
script.charset = 'utf-8';
var current_callback;
if (scripts.length) {
var u = scripts.shift();
current_callback = function() { load(u) }
} else {
current_callback = callback;
}
if (window.ActiveXObject) { // IE
script.onreadystatechange = function() {
if (script.readyState == 'complete' || script.readyState == 'loaded') {
current_callback();
}
}
} else {
script.onload = current_callback;
script.onerror = function() { errorback(url) };
}
script.src = url;
document.body.appendChild(script);
}
}
load(scripts.shift());
})(["http://code.jquery.com/jquery-1.4.2.min.js"], function() {
/*
* @title view web storage
* @description web storage viewer for smartphone
* @include http://*
* @license MIT License
* @require jquery
*/
var css = [
'body {',
' margin: 0;',
' padding: 0;',
'}',
'h1 {',
' font-size: 20px;',
' text-align: center;',
' padding: 10px;',
' margin: 0;',
'}',
'h2 {',
' font-size: 18px;',
' text-align: center;',
' padding: 10px;',
' background: #EEE;',
'}',
'table {',
' width: 100%;',
' border-collapse: collapse;',
' font-size: 14px;',
'}',
'td, th {',
' border: 1px solid #333;',
' padding: 5px;',
'}',
'th {',
' background: #e2e7ff;',
'}',
].join('');
var html = [
'
storage確認ページ
',
'sessionStorage
',
'',
' ',
' ',
' ',
' ',
' キー | ',
' 値 | ',
' 削除 | ',
'
',
'
',
'',
'localStorage
',
'',
' ',
' ',
' ',
' ',
' キー | ',
' 値 | ',
' 削除 | ',
'
',
'
'
].join('');
$('head').empty().append( $('