{"id":885,"date":"2018-09-24T21:20:09","date_gmt":"2018-09-24T12:20:09","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=885"},"modified":"2021-11-07T14:06:34","modified_gmt":"2021-11-07T05:06:34","slug":"mark-js%e3%81%a7%e3%83%9a%e3%83%bc%e3%82%b8%e5%85%a8%e4%bd%93%e3%81%ae%e7%89%b9%e5%ae%9a%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e3%83%8f%e3%82%a4%e3%83%a9%e3%82%a4%e3%83%88%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=885","title":{"rendered":"Mark.js\u3067\u30da\u30fc\u30b8\u306e\u6587\u5b57\u5217\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u3059\u308b"},"content":{"rendered":"<p>JavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u306eMark.js\u3067\u30da\u30fc\u30b8\u5168\u4f53\u306e\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u3059\u308b\u30fb\u8272\u3092\u3064\u3051\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>JavaScript\u30e9\u30a4\u30d6\u30e9\u30eamark.js\u306a\u3089\u3001\u6587\u5b57\u5217\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>\nfunction dynamicallyLoadScript(url) {\n    var script = document.createElement(\"script\");\n    script.src = url;\n    document.head.appendChild(script);\n}\n\n\/\/ \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aad\u307f\u8fbc\u3080\ndynamicallyLoadScript('https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mark.js\/8.11.1\/jquery.mark.es6.min.js')\n\nMark(document.body).mark(\"a\") \/\/ =&gt; \u6587\u5b57\u5217\"a\"\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u3002\n<\/code><\/pre>\n<p>\u6700\u521d\u50d5\u306f\u3001<code>document.body.innerHTML = document.body.innerHTML.replace...<\/code>\u307f\u305f\u3044\u306b\u3084\u308d\u3046\u3068\u3057\u3066\u305f\u3093\u3067\u3059\u304c\u3001<br \/>\n\u3053\u308c\u3084\u308b\u3068\u30ec\u30a4\u30a2\u30a6\u30c8\u5d29\u308c\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057mark.js\u306a\u3089\u3001\u4f55\u6545\u304b\u5d29\u308c\u306a\u3044\u3002\u826f\u3059\u304e\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u3082\u3063\u3068\u7d30\u304b\u304f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092queryselector\u306a\u3093\u304b\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001\u6b63\u898f\u8868\u73fe\u691c\u7d22\u3001\u9664\u5916\u6a5f\u80fd\u306a\u3069\u7d50\u69cb\u5965\u304c\u6df1\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u306eMark.js\u3067\u30da\u30fc\u30b8\u5168\u4f53\u306e\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u30cf\u30a4\u30e9\u30a4\u30c8\u3059\u308b\u30fb\u8272\u3092\u3064\u3051\u308b\u65b9\u6cd5\u306b\u3064\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-eh","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/885"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=885"}],"version-history":[{"count":2,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions"}],"predecessor-version":[{"id":3383,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/885\/revisions\/3383"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}