{"id":881,"date":"2018-04-12T23:18:09","date_gmt":"2018-04-12T14:18:09","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=881"},"modified":"2023-05-27T21:05:50","modified_gmt":"2023-05-27T12:05:50","slug":"%e3%80%90javascript%e3%80%91%e3%82%a4%e3%83%99%e3%83%b3%e3%83%88%e3%83%8f%e3%83%b3%e3%83%89%e3%83%a9%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=881","title":{"rendered":"\u3010JavaScript\u3011\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3001\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>JavaScript\u306f\u3001\u300c<span style=\"color: #ff0000;\"><strong>\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\uff08\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30d6\u30f3\uff09<\/strong><\/span>\u300d\u3068\u3044\u3046\u8003\u3048\u65b9\u304c\u975e\u5e38\u306b\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u6982\u5ff5\u3068\u3057\u3066\u3001\u300c\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u300d\u3084\u300c\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u300d\u3068\u3044\u3046\u6280\u8853\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>JavaScript\u3060\u3051\u3067\u306a\u304f\u3001Android\u7b49\u7d50\u69cb\u591a\u304f\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u6271\u3063\u3066\u3044\u308b\u6982\u5ff5\u306a\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u4e00\u5ea6\u5b66\u7fd2\u3059\u308b\u3068\u5e83\u304f\u751f\u304b\u305b\u307e\u3059\u3002<\/strong><\/span><\/p>\n<h2>\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3068\u306f\uff1f<\/h2>\n<p><strong>\u767a\u751f\u3057\u305f\u30a4\u30d9\u30f3\u30c8\u3092\u6355\u307e\u3048\u308b\u6a5f\u80fd\u306e\u3053\u3068<\/strong>\u3002<\/p>\n<p>\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u3001\u5fc5\u305a\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30a4\u30d9\u30f3\u30c8<\/th>\n<th>\u5bfe\u5fdc\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9<\/th>\n<th>\u52d5\u4f5c\u30bf\u30a4\u30df\u30f3\u30b0<\/th>\n<th>\u5bfe\u5fdc\u3059\u308b\u30bf\u30b0<\/th>\n<\/tr>\n<tr>\n<td>click<\/td>\n<td>onclick<\/td>\n<td>\u30af\u30ea\u30c3\u30af<\/td>\n<td>\u00a0\u307b\u307c\u5168\u3066\u306e\u30bf\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\u00a0load<\/td>\n<td>\u00a0onload<\/td>\n<td>\u30ed\u30fc\u30c9\u3055\u308c\u305f\u6642<\/td>\n<td>body<\/td>\n<\/tr>\n<tr>\n<td>blur<\/td>\n<td>\u00a0onblur<\/td>\n<td>\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u96e2\u308c\u305f\u6642<\/td>\n<td>input\u7b49<\/td>\n<\/tr>\n<tr>\n<td>mouseover<\/td>\n<td>\u00a0onmouseover<\/td>\n<td>\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\uff08\u30ed\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\uff09\u3057\u305f\u6642<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u8a18\u8ff0\u65b9\u6cd5<\/h2>\n<h3>HTML\u30bf\u30b0\u306b\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5<\/h3>\n<p>\u76f4\u63a5\u3001\u30dc\u30bf\u30f3\u306b\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068start\u95a2\u6570\u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">&lt;input type=\"button\" value=\"\u30dc\u30bf\u30f3\" onclick=\"start()\" \/&gt;<\/pre>\n<h3>\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5<\/h3>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3068\u3001document\u306eform\u8981\u7d20\u306e\u3001\u30dc\u30bf\u30f3\u8981\u7d20\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068start\u95a2\u6570\u3092\u547c\u3073\u51fa\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">document.form.btn.onclick=start;<\/pre>\n<p>\u5b9f\u52d9\u3067\u3088\u304f\u898b\u304b\u3051\u308b\u306e\u306f\u3001\u3084\u306f\u308a\u3001\u524d\u8005\u306e<strong>\u300cHTML\u30bf\u30b0\u306b\u76f4\u63a5\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u300d<\/strong>\u3067\u3057\u3087\u3046\u306d\u3002<\/p>\n<h2>\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u3068\u306f\uff1f<\/h2>\n<p>\u540c\u3058\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u8907\u6570\u767b\u9332\u3067\u304d\u308b\u6a5f\u80fd\u306e\u3053\u3068\u3002<\/p>\n<p>\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u5834\u5408\u306f\u3001<strong>\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u3001\u5fc5\u305a\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u304c\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3057\u305f<\/strong>\u304c\u3001\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u306e\u5834\u5408\u306f\u3001<strong>\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u306b\u5bfe\u3057\u3066\u3001\u8907\u6570\u7d50\u3073\u3064\u3051\u308b\u3082\u306e<\/strong>\u3067\u3059\u3002<\/p>\n<h3>\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u308b\u3002<\/h3>\n<pre class=\"lang:default decode:true\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"ja\"&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"utf-8\"&gt;\r\n&lt;title&gt;\u6328\u62f6\u30c6\u30b9\u30c8&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;input id=\"aisatu\" type=\"button\" value=\"\u6328\u62f6\" \/&gt;\r\n&lt;script src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.0\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n$(function(){\r\nfunction hello(){\r\nconsole.log('\u3053\u3093\u306b\u3061\u306f\uff01');\r\n}\r\nfunction goodEvening(){\r\nconsole.log('\u3053\u3093\u3070\u3093\u308f\uff01!');\r\n}\r\n\r\nvar p = document.getElementById('aisatu');\r\n\r\np.addEventListener('click', hello, false);\r\np.addEventListener('click', goodEvening, false);\r\n});\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u306a\u304a\u3001addEventListener\u306b\u6e21\u3057\u3066\u3044\u308b\u5f15\u6570\u306e\u30e1\u30bd\u30c3\u30c9\uff08hello\u3001goodEvening\uff09\u306f<span style=\"color: #ff0000;\"><strong>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\uff08\u5f15\u6570\u306b\u6e21\u3057\u3066\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u95a2\u6570\u306e\u3053\u3068\uff09<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u3001\u4e8c\u3064\u306e\u95a2\u6570\u306e\u7d50\u679c\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-899\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca.png\" alt=\"\" width=\"151\" height=\"44\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca.png 151w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/04\/\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca-150x44.png 150w\" sizes=\"(max-width: 151px) 100vw, 151px\" \/><\/p>\n<p>\u901a\u5e38\u3001\u300cclick\u300d\u30a4\u30d9\u30f3\u30c8\u306b\u306f\u3001\u4e00\u3064\u306e\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3057\u304b\u7d50\u3073\u4ed8\u3051\u3089\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u300caddEventListener\u300d\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001<strong>\u8907\u6570\u306e\u95a2\u6570\u3092\u7d10\u3065\u3051\u3066\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p>\u306a\u304a\u3001\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300cgetElementById\u300d\u306f\u3001\u5bfe\u8c61\u306e\u8981\u7d20\uff08\u4eca\u56de\u306e\u5834\u5408\u3067\u8a00\u3048\u3070\u3001aisatu\u30dc\u30bf\u30f3\uff09\u306e\u8aad\u307f\u8fbc\u307f\u3093\u3060\u5f8c\u306bJavaScript\u3092\u8a18\u8ff0\u3057\u306a\u3044\u3068\u3001\u8981\u7d20\u304c\u5b58\u5728\u3057\u306a\u3044\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u6ce8\u610f<\/strong><\/span>\u3067\u3059\u3002\u3082\u3057\u304f\u306f\u3001jQuery\u306e\u300c$(function(){\u2026});\u300d\uff08\u30da\u30fc\u30b8\u8aad\u307f\u8fbc\u307f\u5b8c\u4e86\u5f8c\u306b\u5b9f\u884c\u3059\u308b\uff09\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>this\u306b\u3064\u3044\u3066<\/h2>\n<p>\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u914d\u4e0b\u3067\u306f\u3001this\u306f\u30a4\u30d9\u30f3\u30c8\u306e\u767a\u751f\u5143\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u914d\u4e0b\u3067\u5909\u6570\u3092\u5229\u7528\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u30a8\u30e9\u30fc\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4e0d\u90fd\u5408\u3092\u89e3\u6d88\u3059\u308b\u306e\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u300cFunction\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u306e\u300cbind\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>bind\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u95a2\u6570\u914d\u4e0b\u306ethis\u304c\u5f15\u6570\u306b\u7d10\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"JavaScript\u306f\u3001\u300c\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\uff08\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30d6\u30f3\uff09\u300d\u3068\u3044\u3046\u8003\u3048\u65b9\u304c\u975e\u5e38\u306b\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002 \u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u6982\u5ff5\u3068\u3057\u3066\u3001\u300c\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u300d\u3084\u300c\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u300d\u3068\u3044\u3046\u6280\u8853\u304c\u3042\u308a\u307e\u3059\u3002 JavaScript [&hellip;]","protected":false},"author":1,"featured_media":901,"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\/881"}],"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=881"}],"version-history":[{"count":24,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/881\/revisions"}],"predecessor-version":[{"id":20315,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/881\/revisions\/20315"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/901"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=881"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}