{"id":13859,"date":"2013-11-14T09:45:46","date_gmt":"2013-11-14T00:45:46","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=13859"},"modified":"2013-11-14T09:45:46","modified_gmt":"2013-11-14T00:45:46","slug":"exel-with-javascript","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/exel-with-javascript\/","title":{"rendered":"\u305f\u3063\u305f29\u884c\u3067Excel\u3092\u518d\u73fe\u3057\u305fJavaScript\u30b3\u30fc\u30c9\u304c\u51c4\u3044"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/11\/blogjavascript.png\" alt=\"Javascript\" title=\"javascript.png\" border=\"0\" width=\"560\" height=\"251\" \/><\/p>\n<p>\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u308f\u305a\u305f\u3063\u305f29\u884c\u3067Excel\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u6a5f\u80fd\u3092\u518d\u73fe\u3057\u305fJavaScript\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059(<a href=\"http:\/\/jsfiddle.net\/ondras\/hYfN3\/\">jsfiddle<\/a>\u3001<a href=\"http:\/\/www.reddit.com\/r\/programming\/comments\/1qjn4h\/tiny_excellike_app_in_vanilla_js\/\">reddit<\/a>)\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/11\/blogcalc.png\" alt=\"Calc\" title=\"calc.png\" border=\"0\" width=\"477\" height=\"177\" \/><\/p>\n<p>\u3082\u3061\u308d\u3093\u304a\u99b4\u67d3\u307f\u306e\u8a08\u7b97\u5f0f<strong>\u300c=A1+B2\u300d<\/strong>\u306a\u3069\u3082\u4f7f\u7528\u53ef\u80fd\u3002\u8a08\u7b97\u306e\u5faa\u74b0\u9632\u6b62\u6a5f\u80fd\u3084\u3001\u81ea\u52d5\u7684\u306blocalStorage\u306b\u5024\u3092\u4fdd\u5b58\u3059\u308b\u6a5f\u80fd\u306a\u3069\u3082\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\n\u554f\u984c\u306eJavaScript\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre><code class=\"javascript\">for (var i=0; i<6; i++) {\n    var row = document.querySelector(\"table\").insertRow(-1);\n    for (var j=0; j<6; j++) {\n        var letter = String.fromCharCode(\"A\".charCodeAt(0)+j-1);\n        row.insertCell(-1).innerHTML = i&&j ? \"<input id='\"+ letter+i +\"'\/>\" : i||letter;\n    }\n}\n\nvar DATA={}, INPUTS=[].slice.call(document.querySelectorAll(\"input\"));\nINPUTS.forEach(function(elm) {\n    elm.onfocus = function(e) {\n        e.target.value = localStorage[e.target.id] || \"\";\n    };\n    elm.onblur = function(e) {\n        localStorage[e.target.id] = e.target.value;\n        computeAll();\n    };\n    var getter = function() {\n        var value = localStorage[elm.id] || \"\";\n        if (value.charAt(0) == \"=\") {\n            with (DATA) return eval(value.substring(1));\n        } else { return isNaN(parseFloat(value)) ? value : parseFloat(value); }\n    };\n    Object.defineProperty(DATA, elm.id, {get:getter});\n    Object.defineProperty(DATA, elm.id.toLowerCase(), {get:getter});\n});\n(window.computeAll = function() {\n    INPUTS.forEach(function(elm) { try { elm.value = DATA[elm.id]; } catch(e) {} });\n})();\n\n<\/code><\/pre>\n<p>\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u306e\u30b3\u30fc\u30c9\u3068\u3001HTML\u3068CSS\u3067Excel\u98a8\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304c\u5b9f\u73fe\u3067\u304d\u308b\u306e\u306f\u3059\u3054\u3044\u3067\u3059\u306d\u3002<br \/>\nreddit\u3067\u306f\u8106\u5f31\u6027\u306e\u554f\u984c\u304c\u3042\u308b(?)\u3068\u3044\u3063\u305f\u6307\u6458\u3082\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u5b9f\u7528\u3059\u308b\u969b\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30d2\u30e9\u30e1\u30ad\u3092\u611f\u3058\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002JavaScript\u306e\u52c9\u5f37\u306b\u3082\u306a\u308b\u304b\u3082\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u308f\u305a\u305f\u3063\u305f29\u884c\u3067Excel\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u6a5f\u80fd\u3092\u518d\u73fe\u3057\u305fJavaScript\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059(jsfiddle\u3001reddit)\u3002 \u3082\u3061\u308d\u3093\u304a\u99b4\u67d3\u307f\u306e\u8a08\u7b97\u5f0f\u300c=A1+B2\u300d\u306a\u3069\u3082\u4f7f\u7528\u53ef\u80fd\u3002\u8a08\u7b97 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":13857,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[66,75],"tags":[832,655],"class_list":["post-13859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webservice","category-software","tag-excel","tag-javascript"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/13859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=13859"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/13859\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/13857"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=13859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=13859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=13859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}