{"id":1481,"date":"2015-01-21T17:00:17","date_gmt":"2015-01-21T08:00:17","guid":{"rendered":"http:\/\/appsweets.net\/blog\/?p=1481"},"modified":"2015-01-21T17:00:17","modified_gmt":"2015-01-21T08:00:17","slug":"for-firefox-2","status":"publish","type":"post","link":"https:\/\/appsweets.net\/blog\/2015\/01\/21\/for-firefox-2\/","title":{"rendered":"for Firefox #2"},"content":{"rendered":"<div class=\"db9cc8cdb64025d13c1cc9dad0a0e262\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>\u4f8b\u3048\u3070\u7d9a\u304d\u3092\u8aad\u3093\u3060\u969b\u306b\u3001\u6700\u65b0\u306e\u30ec\u30b9\u6570\u3092\u53cd\u6620\u3055\u305b\u305f\u308a\u3059\u308b\u3002\u305d\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u7c21\u5358\u306b\u8a00\u3048\u3070<br \/>\n<code lang=\"html\"><span id=\"replies-total\"><\/span> \u30ec\u30b9<\/code><br \/>\n\u307f\u305f\u3044\u306a\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u306b\u5bfe\u3057\u3066\u3001javascript \u3067<br \/>\n<code lang=\"javascript\"><br \/>\ndocument.getElementById('replies-total').textContent = '100';<br \/>\n<\/code><br \/>\n\u306a\u3069\u3068\u3059\u308c\u3070\u3044\u3044\u308f\u3051\u3060\u3002<\/p>\n<p>\u3057\u304b\u3057\u5b9f\u969b\u306b\u306f\u3053\u306e\u624b\u306e\u30b3\u30fc\u30c9\u306f\u8d64\u798f\u30d7\u30e9\u30b9\u306e\u4e2d\u306b\u306f\u306a\u3044\u3002\u5b9f\u969b\u306e\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u306f<br \/>\n<code lang=\"html\"><span id=\"replies-total\" data-binding=\"template:replies-total\"><\/span> \u30ec\u30b9<\/code><br \/>\n\u306a\u3069\u3068 binding \u5c5e\u6027\u304c\u4ed8\u52a0\u3057\u3066\u3042\u308b\u3002\u305d\u308c\u3067\u3001\u6c4e\u7528\u7684\u306a\u518d\u30d0\u30a4\u30f3\u30c9\u95a2\u6570\u3092\u547c\u3076\u3053\u3068\u306b\u3088\u308a\u3001binding \u5c5e\u6027\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u305b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u518d\u30d0\u30a4\u30f3\u30c9\u95a2\u6570\u5185\u3067\u306f\u3001\u30d0\u30a4\u30f3\u30c9\u306e\u63a5\u982d\u8f9e\u304c [cci]xpath:[\/cci] \u3067\u3042\u308c\u3070\u3075\u305f\u3070\u306e\u30b5\u30fc\u30d0\u304c\u8fd4\u3057\u305f html \u3092\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u305f\u7d50\u679c\u306e\u4e2d\u9593 xml \u304b\u3089\u306e xpath \u306e\u7d50\u679c\u3001\u3042\u308b\u3044\u306f [cci]template:[\/cci] \u3067\u3042\u308c\u3070\u4e2d\u9593 xml \u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3057\u3066\u4e0e\u3048\u305f XSL \u306e\u5909\u63db\u306e\u7d50\u679c\u3092\u7528\u3044\u3066\u8981\u7d20\u306e\u5185\u5bb9\u3092\u7f6e\u63db\u3059\u308b\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u306e\u8a71\u984c\u306f\u305d\u306e\u3001\u6587\u66f8\u306e\u4e00\u90e8\u5206\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u547c\u3070\u308c\u308b XSL \u5909\u63db\u3060\u3002\u6587\u66f8\u306e\u4e00\u90e8\u3068\u3044\u3063\u3066\u3082\u3001\u5909\u63db\u306b\u969b\u3057\u3066\u4f7f\u7528\u3059\u308b\u4e00\u6642\u7684\u306a\u6587\u66f8\u306f html \u8981\u7d20\u304b\u3089\u59cb\u307e\u308b\u307e\u3063\u3068\u3046\u306a\u305d\u308c\u3067\u3042\u308b\u3002\u3064\u307e\u308a<br \/>\n<code lang=\"xml\"><br \/>\n<xsl:template match=\"futaba\" mode=\"threads\"><br \/>\n<html><body><xsl:apply-templates select=\"thread\"\/><\/body><\/html><br \/>\n<\/xsl:template><br \/>\n<\/code><br \/>\n\u3068\u3053\u3093\u306a\u611f\u3058\u3002\u3053\u306e\u5909\u63db\u7d50\u679c\u3092\u3001XSLTProcessor#transformToFragment() \u3092\u7528\u3044\u3066 DocumentFragment \u3068\u3057\u3066\u5f97\u308b\u3002<\/p>\n<p>\u3053\u306e\u6642\u3001\u8fd4\u3063\u3066\u304f\u308b\u8981\u7d20\u306e\u30c4\u30ea\u30fc\u69cb\u9020\u304c Firefox \u3068\u305d\u306e\u4ed6\u3067\u5fae\u5999\u306b\u9055\u3046\u3002Presto Opera \u3068 Chrome \u306f\u3001DocumentFragment \u306e\u5b50\u8981\u7d20\u3068\u3057\u3066 body \u8981\u7d20\u306e\u5b50\u8981\u7d20\u3092\u5272\u308a\u5f53\u3066\u308b\u3002\u4e00\u65b9 Firefox \u306f\u3001\u5358\u7d14\u306b DocumentFragment \u306e\u5b50\u8981\u7d20\u3068\u3057\u3066 html \u8981\u7d20\u3092\u5272\u308a\u5f53\u3066\u308b\u3002<\/p>\n<p>\u3069\u3061\u3089\u304c\u6b63\u3057\u3044\u306e\u3060\u308d\u3046\u304b\u3002\u6b63\u3057\u3055\u3068\u3044\u3046\u306e\u306f\u9055\u3046\u304b\u3002\u305d\u3082\u305d\u3082 \u30d6\u30e9\u30a6\u30b6\u306e javascript \u304b\u3089\u5229\u7528\u3067\u304d\u308b XSLTProcessor \u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u8ab0\u304c\u8003\u3048\u3066\u7ba1\u7406\u3057\u3066\u308b\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u3068\u308a\u3042\u3048\u305a Opera \u3068 Chrome \u306e\u52d5\u4f5c\u306e\u307b\u3046\u304c\u3001\u305d\u306e\u307e\u307e\u5358\u7d14\u306b DocumentFragment \u3092 appendChild() \u306e\u5f15\u6570\u306b\u3067\u304d\u308b\u306e\u3067\u697d\u3060\u3057\u3001\u4f55\u3088\u308a\u591a\u6570\u6d3e\u3060\u3002\u4e00\u65b9\u3067\u3001\u52d5\u4f5c\u3068\u3057\u3066\u306f Firefox \u306e\u307b\u3046\u304c\u7d20\u76f4\u3067\u306f\u3042\u308b\u3002body \u8981\u7d20\u3092\u7279\u5225\u6271\u3044\u3057\u307e\u3059\u7684\u306a\u4f8b\u5916\u4e2d\u306e\u4f8b\u5916\u52d5\u4f5c\u306f\u4f55\u306a\u3093\u3060\u308d\u3046\u304b\u3002DocumentFragment \u306f\u3042\u304f\u307e\u3067\u65ad\u7247\u306a\u306e\u3067 html\/head\/body \u3068\u3044\u3063\u305f\u5927\u7269\u306f\u5bfe\u8c61\u306b\u3057\u306a\u3044\u3001\u307f\u305f\u3044\u306a\u30eb\u30fc\u30eb\u304c\u3042\u308b\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u3057\u304b\u3057\u8ab0\u304c\u305d\u306e\u4ed5\u69d8\u3092\u6c7a\u3081\u3066\u3044\u308b\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u5f97\u305f DocumentFragment \u304c body \u8981\u7d20\u3092\u6301\u3063\u3066\u3044\u305f\u3089\u3001\u3055\u3089\u306b body \u306e\u5b50\u8981\u7d20\u3092 DocumentFragment \u3068\u3057\u3066\u304f\u304f\u308a\u51fa\u3059\u3088\u3046\u306b\u3057\u305f\u3002\u304f\u304f\u308a\u51fa\u3059\u6642\u306b Range \u3092\u4f7f\u3046\u306e\u3060\u304c\u3001\u3053\u308c\u304c\u3061\u3083\u3093\u3068 DocumentFragment \u306b\u3082\u4f5c\u7528\u3059\u308b\u306e\u304b\u78ba\u8a3c\u306f\u6301\u3066\u306a\u3044\uff08DocumentFragment \u306f Document \u306e\u3044\u308f\u3070\u30b5\u30d6\u30af\u30e9\u30b9\u306a\u306e\u3067 Range \u306b\u3088\u308b\u64cd\u4f5c\u3082\u7406\u5c48\u306e\u4e0a\u3067\u306f\u4e92\u63db\u6027\u304c\u3042\u308b\u306f\u305a\u306a\u306e\u3060\u304c\u3001DocumentFragment \u306b\u5bfe\u3059\u308b\u64cd\u4f5c\u3068\u3044\u3046\u306e\u306f\u3051\u3063\u3053\u3046\u3069\u306e\u30d6\u30e9\u30a6\u30b6\u3082\u602a\u3057\u3044\u3001\u3042\u308b\u3044\u306f\u602a\u3057\u3044\u6642\u671f\u304c\u3042\u3063\u305f\u306e\u3060\uff09\u3002\u3067\u3082\u307e\u3042\u3001\u3068\u308a\u3042\u3048\u305a\u52d5\u3044\u3066\u3044\u308b\u3088\u3046\u3060\u3002<br \/>\n<code lang=\"javascript\"><br \/>\nfunction fixFragment (\/*DocumentFragment*\/f) {<br \/>\n    var bodies = f.querySelectorAll('body');<br \/>\n    if (bodies.length == 0) return f;<br \/>\n    var r = document.createRange();<br \/>\n    r.selectNodeContents(bodies[0]);<br \/>\n    return r.cloneContents();<br \/>\n}<br \/>\n<\/code><\/p>\n<div class=\"db9cc8cdb64025d13c1cc9dad0a0e262\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u4f8b\u3048\u3070\u7d9a\u304d\u3092\u8aad\u3093\u3060\u969b\u306b\u3001\u6700\u65b0\u306e\u30ec\u30b9\u6570\u3092\u53cd\u6620\u3055\u305b\u305f\u308a\u3059\u308b\u3002\u305d\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u7c21\u5358\u306b\u8a00\u3048\u3070 \u30ec\u30b9 \u307f\u305f\u3044\u306a\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u306b\u5bfe\u3057\u3066\u3001javascript \u3067 document.getElementById(&#8216;replies-total&#8217;).textContent = &#8216;100&#8217;; \u306a\u3069\u3068\u3059\u308c\u3070\u3044\u3044\u308f\u3051\u3060\u3002 \u3057\u304b\u3057\u5b9f\u969b\u306b\u306f\u3053\u306e\u624b\u306e\u30b3\u30fc\u30c9\u306f\u8d64\u798f\u30d7\u30e9\u30b9\u306e\u4e2d\u306b\u306f\u306a\u3044\u3002\u5b9f\u969b\u306e\u30de\u30fc\u30af\u30a2\u30c3\u30d7\u306f \u30ec\u30b9 \u306a\u3069\u3068 binding \u5c5e\u6027\u304c\u4ed8\u52a0\u3057\u3066\u3042\u308b\u3002\u305d\u308c\u3067\u3001\u6c4e\u7528\u7684\u306a\u518d\u30d0\u30a4\u30f3\u30c9\u95a2\u6570\u3092\u547c\u3076\u3053\u3068\u306b\u3088\u308a\u3001binding \u5c5e\u6027\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u305b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u518d\u30d0\u30a4\u30f3\u30c9\u95a2\u6570\u5185\u3067\u306f\u3001\u30d0\u30a4\u30f3\u30c9\u306e\u63a5\u982d\u8f9e\u304c [cci]xpath:[\/cci] \u3067\u3042\u308c\u3070\u3075\u305f\u3070\u306e\u30b5\u30fc\u30d0\u304c\u8fd4\u3057\u305f html \u3092\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u305f\u7d50\u679c\u306e\u4e2d\u9593 xml \u304b\u3089\u306e xpath \u306e\u7d50\u679c\u3001\u3042\u308b\u3044\u306f [cci]template:[\/cci] \u3067\u3042\u308c\u3070\u4e2d\u9593 xml \u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3057\u3066\u4e0e\u3048\u305f XSL \u306e\u5909\u63db\u306e\u7d50\u679c\u3092\u7528\u3044\u3066\u8981\u7d20\u306e\u5185\u5bb9\u3092\u7f6e\u63db\u3059\u308b\u3002 \u3053\u306e\u8a18\u4e8b\u306e\u8a71\u984c\u306f\u305d\u306e\u3001\u6587\u66f8\u306e\u4e00\u90e8\u5206\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u547c\u3070\u308c\u308b XSL \u5909\u63db\u3060\u3002\u6587\u66f8\u306e\u4e00\u90e8\u3068\u3044\u3063\u3066\u3082\u3001\u5909\u63db\u306b\u969b\u3057\u3066\u4f7f\u7528\u3059\u308b\u4e00\u6642\u7684\u306a\u6587\u66f8\u306f html \u8981\u7d20\u304b\u3089\u59cb\u307e\u308b\u307e\u3063\u3068\u3046\u306a\u305d\u308c\u3067\u3042\u308b\u3002\u3064\u307e\u308a \u3068\u3053\u3093\u306a\u611f\u3058\u3002\u3053\u306e\u5909\u63db\u7d50\u679c\u3092\u3001XSLTProcessor#transformToFragment() \u3092\u7528\u3044\u3066 DocumentFragment \u3068\u3057\u3066\u5f97\u308b\u3002 \u3053\u306e\u6642\u3001\u8fd4\u3063\u3066\u304f\u308b\u8981\u7d20\u306e\u30c4\u30ea\u30fc\u69cb\u9020\u304c Firefox \u3068\u305d\u306e\u4ed6\u3067\u5fae\u5999\u306b\u9055\u3046\u3002Presto &hellip; <a href=\"https:\/\/appsweets.net\/blog\/2015\/01\/21\/for-firefox-2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10,7,5],"class_list":["post-1481","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-akahukuplus","tag-firefox","tag-javascript"],"_links":{"self":[{"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/comments?post=1481"}],"version-history":[{"count":7,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1481\/revisions"}],"predecessor-version":[{"id":1488,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/1481\/revisions\/1488"}],"wp:attachment":[{"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/media?parent=1481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/categories?post=1481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/tags?post=1481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}