{"id":871,"date":"2018-04-12T22:55:17","date_gmt":"2018-04-12T13:55:17","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=871"},"modified":"2021-08-17T10:55:55","modified_gmt":"2021-08-17T01:55:55","slug":"%e3%80%90javascript%e3%80%91%e3%82%b3%e3%83%bc%e3%83%ab%e3%83%90%e3%83%83%e3%82%af%e9%96%a2%e6%95%b0%e3%81%a8%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=871","title":{"rendered":"\u3010JavaScript\u3011\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u3084\u3001\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u305f\u307e\u306b\u3001\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u3063\u3066\u805e\u304d\u307e\u3059\u304c\u3001\u3088\u304f\u7406\u89e3\u3092\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3068\u306f\uff1f<\/h2>\n<p><strong>\u300c\u5f15\u6570\u3068\u3057\u3066\u6e21\u3055\u308c\u308b\u95a2\u6570\u300d\u306e\u3053\u3068\u3002<\/strong><\/p>\n<p>JavaScript\u306f<span style=\"color: #ff0000;\"><strong>\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\uff08\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304b\uff09<\/strong><\/span>\u306a\u306e\u3067\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u8272\u3005\u3068\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u306a\u304a\u3001JavaScript\u3067\u306f\u767b\u9332\u3059\u308b\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306e\u30b7\u30b0\u30cd\u30c1\u30e3\uff08\u95a2\u6570\u306e\u578b\uff09\u306f\u3042\u3089\u304b\u3058\u3081\u4ed5\u69d8\u3067\u6c7a\u307e\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u8981\u3059\u308b\u306b\u2026\u3002<\/h2>\n<p>JavaScript\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u95a2\u6570\u3092\u5909\u6570\u306b\u4ee3\u5165\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001<strong>\u305d\u306e\u4ee3\u5165\u3057\u305f\u5909\u6570\u3092\u3055\u3089\u306b\u5225\u306e\u95a2\u6570\u306b\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u3053\u3068\u3067\u3001\u5f15\u304d\u6e21\u3057\u305f\u95a2\u6570\u306e\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3001\u5f15\u6570\u306e\u95a2\u6570\u3092\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068<\/strong>\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvar callbackTest = function () {\r\n console.log('Hello World');\r\n}\r\n<\/pre>\n<h2>\u7528\u9014<\/h2>\n<p>JavaScrip\u306f\u3001\u975e\u540c\u671f\uff08\u3044\u3061\u3044\u3061\u4e00\u3064\u306e\u51e6\u7406\u3092\u5f85\u3063\u3066\u304a\u3089\u305a\u3001\u6642\u9593\u304c\u304b\u304b\u308b\u3088\u3046\u3067\u3042\u308c\u3070\u3001\u51e6\u7406\u306e\u7d50\u679c\u3092\u5f85\u305f\u305a\u306b\u6b21\u306e\u884c\u3092\u5b9f\u884c\u3059\u308b\u7b49\uff09\u3067\u52d5\u304f\u306e\u3067\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u540c\u671f\u51e6\u7406\uff08\u51e6\u7406\u3092\u9806\u756a\u306b\u5b9f\u884c\u3059\u308b\uff09\u3092\u5b9f\u73fe\u3057\u305f\u3044<\/strong><\/span>\u5834\u5408\u306b\u826f\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30d7\u30ed\u30fc\u30c1\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u300c\u975e\u540c\u671f\u51e6\u7406\u300d<\/strong><\/span>\u306b\u3064\u3044\u3066\u306f\u3001\u8a73\u3057\u304f\u306f\u3001\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4e0d\u5b89\u306a\u65b9\u306f\u5fa1\u89a7\u4e0b\u3055\u3044\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"v0SvyOvM2I\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=5623\">\u3010JavaScript\u3011\u300c\u975e\u540c\u671f\u51e6\u7406\u300d\u306b\u3064\u3044\u3066\u3057\u3063\u304b\u308a\u7406\u89e3\u3059\u308b\u3002<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=5623&#038;embed=true#?secret=v0SvyOvM2I\" data-secret=\"v0SvyOvM2I\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011\u300c\u975e\u540c\u671f\u51e6\u7406\u300d\u306b\u3064\u3044\u3066\u3057\u3063\u304b\u308a\u7406\u89e3\u3059\u308b\u3002&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u69d8\u3005\u306a\u5c40\u9762\u3067\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u5229\u7528\u3055\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>setTimeout\u30e1\u30bd\u30c3\u30c9<\/li>\n<li>setInterval\u30e1\u30bd\u30c3\u30c9<\/li>\n<li>XMLHttpRequest\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/li>\n<\/ul>\n<h2>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306e\u554f\u984c\u70b9\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u300d\u306b\u3064\u3044\u3066<\/h2>\n<p>\u975e\u540c\u671f\u51e6\u7406\u304c\u3001\u3044\u304f\u3064\u3082\u9023\u306a\u308b\u5834\u5408\u306f\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3067\u306f\u5165\u308c\u5b50\u304c\u6df1\u304f\u306a\u308a\u3059\u304e\u3066\u30011\u3064\u306e\u95a2\u6570\u304c\u80a5\u5927\u5316\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u304c\u8d77\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u3092<span style=\"color: #ff0000;\"><strong>\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u300d<\/strong><\/span>\u3068\u547c\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u89e3\u6c7a\u3059\u308b\u624b\u6cd5\u3068\u3057\u3066\u3001<span style=\"color: #ff0000;\"><strong>Promise\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3068\u3044\u3046\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Promise\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3064\u3044\u3066\u3001\u8a73\u3057\u304f\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"juUsJMQ7BZ\"><p><a href=\"http:\/\/www.code-magagine.com\/?p=5522\">\u3010JavaScript\u3011\u975e\u540c\u671f\u51e6\u7406\u3092\u7c21\u5358\u306b\u3057\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u304b\u3089\u8131\u51fa\u3055\u305b\u308b\u300cPromise\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u306b\u3064\u3044\u3066<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.code-magagine.com\/?p=5522&#038;embed=true#?secret=juUsJMQ7BZ\" data-secret=\"juUsJMQ7BZ\" width=\"500\" height=\"282\" title=\"&#8220;\u3010JavaScript\u3011\u975e\u540c\u671f\u51e6\u7406\u3092\u7c21\u5358\u306b\u3057\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u5730\u7344\u304b\u3089\u8131\u51fa\u3055\u305b\u308b\u300cPromise\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u306b\u3064\u3044\u3066&#8221; &#8212; \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30de\u30ac\u30b8\u30f3\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2>\u5b9f\u969b\u306b\u5b9f\u88c5\u3057\u3066\u307f\u308b\u3002<\/h2>\n<p>\u308f\u304b\u308a\u3084\u3059\u304f\u5b9f\u88c5\u3059\u308b\u3068\u3057\u305f\u3089\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n\/\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\r\nvar callbackTest = function () {\r\nconsole.log('Hello World');\r\n}\r\n\r\n\/\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\nfunction execCallback (callbackTest) {\r\nconsole.log('callback\u524d\u51e6\u7406');\r\ncallbackTest();\r\n}\r\n\r\n\/\/ \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u95a2\u6570\u306b\u6e21\u3057\u3066\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u5b9f\u884c\u3057\u3066\u3082\u3089\u3046\u3002\r\nexecCallback(callbackTest);\r\n\r\n<\/pre>\n<p>\u51e6\u7406\u7d50\u679c\u3068\u3057\u3066\u306f\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u30cb\u4e0b\u8a18\u306e\u3088\u3046\u306b\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-877\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570.png\" alt=\"\" width=\"308\" height=\"84\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570.png 308w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570-300x82.png 300w\" sizes=\"(max-width: 308px) 100vw, 308px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"\u305f\u307e\u306b\u3001\u300c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u300d\u3063\u3066\u805e\u304d\u307e\u3059\u304c\u3001\u3088\u304f\u7406\u89e3\u3092\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002 \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3068\u306f\uff1f \u300c\u5f15\u6570\u3068\u3057\u3066\u6e21\u3055\u308c\u308b\u95a2\u6570\u300d\u306e\u3053\u3068\u3002 JavaScript\u306f\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\uff08\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068 [&hellip;]","protected":false},"author":1,"featured_media":880,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/871"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=871"}],"version-history":[{"count":12,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/871\/revisions"}],"predecessor-version":[{"id":14064,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/871\/revisions\/14064"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/880"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=871"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}