{"id":667,"date":"2009-03-03T09:03:26","date_gmt":"2009-03-03T01:03:26","guid":{"rendered":"http:\/\/fdream.net\/blog\/article\/667.aspx"},"modified":"2009-03-03T09:03:59","modified_gmt":"2009-03-03T01:03:59","slug":"Mootools%e5%b8%b8%e7%94%a8%e6%96%b9%e6%b3%95%e6%89%a9%e5%b1%95%ef%bc%88%e4%ba%94%ef%bc%89","status":"publish","type":"post","link":"https:\/\/fdream.net\/blog\/article\/667","title":{"rendered":"Mootools\u5e38\u7528\u65b9\u6cd5\u6269\u5c55\uff08\u4e94\uff09"},"content":{"rendered":"<p>\u7ee7\u7eedMootools\u7684\u6269\u5c55\uff0c\u9002\u7528\u4e8eMootools 1.1\u53ca1.2\uff0c\u8fd9\u6b21\u5728Element\u6269\u5c55\u4e86\u4e24\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u4e00\u4e2a\u7528\u6765\u83b7\u53d6\u6216\u8005\u8bbe\u7f6e\u4e00\u4e2a\u5143\u7d20\u7684innerHTML\uff08\u8fd9\u4e2a\u662f\u6a21\u4effjQuery\u91cc\u9762\u7684html()\u65b9\u6cd5\uff09\uff0c\u8fd8\u4e00\u4e2a\u65b9\u6cd5\u662f\u628a\u4e00\u4e2a\u8868\u5355\u5bf9\u8c61\u8f6c\u6210hash\u5bf9\u8c61\uff0c\u7528\u5f97\u6bd4\u8f83\u5c11\u4e00\u70b9\u3002<\/p>\n<h3>\u65b9\u6cd5\uff1ahtml<\/h3>\n<p>\u8bf4\u660e\uff1a\u5f53\u53c2\u6570\u4e0d\u4e3a\u7a7a\u65f6\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u5143\u7d20\u7684innerHTML\uff0c\u5f53\u53c2\u6570\u4e3a\u7a7a\u65f6\uff0c\u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684innerHTML\u3002<\/p>\n<p><pre lang=\"javascript\">\nElement.implement({\n    html: function(s) {\n        \/\/\/&lt;summary&gt;\n        \/\/\/ \u83b7\u53d6\u5143\u7d20\u7684HTML\u5185\u5bb9\u6216\u8005\u8bbe\u7f6e\u5143\u7d20\u7684HTML\u5185\u5bb9\n        \/\/\/&lt;\/summary&gt;\n        \/\/\/&lt;param name=&quot;s&quot; type=&quot;String&quot;&gt;\u53c2\u6570\u4e3a\u7a7a\u65f6\uff0c\u83b7\u53d6HTML\u5185\u5bb9\uff1b\u53c2\u6570\u4e3a\u5b57\u7b26\u4e32\u65f6\uff0c\u8bbe\u7f6eHTML\u7684\u5185\u5bb9&lt;\/param&gt;\n        \/\/\/&lt;returns type=&quot;String&quot; \/&gt;\n        if (s === undefined) {\n            return this.get('html');\n        }\n        else {\n            this.set('html', s + '');\n            return s;\n        }\n    }\n});\n<\/pre>\n<\/p>\n<h3>\u65b9\u6cd5\uff1atoHash<\/h3>\n<p>\u8bf4\u660e\uff1a\u628a\u4e00\u4e2a\u8868\u5355\u5bf9\u8c61\u8f6c\u6362\u6210\u4e3a\u4e00\u4e2aHash\u5bf9\u8c61\uff0c\u65b9\u4fbf\u9a8c\u8bc1\u5904\u7406\u3002<\/p>\n<p><pre lang=\"javascript\">\nElement.implement({\n    toHash: function() {\n        \/\/\/&lt;summary&gt;\n        \/\/\/ \u628a\u4e00\u4e2a\u8868\u5355\u8f6c\u6210Hash\u5bf9\u8c61\n        \/\/\/&lt;\/summary&gt;\n        \/\/\/&lt;returns type=&quot;Hash&quot; \/&gt;\n        return this.toQueryString().toHash();\n    }\n});\n<\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ee7\u7eedMootools\u7684\u6269\u5c55\uff0c\u9002\u7528\u4e8eMootools 1.1\u53ca1.2\uff0c\u8fd9\u6b21\u5728Element\u6269\u5c55\u4e86\u4e24\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u4e00\u4e2a\u7528\u6765\u83b7\u53d6\u6216\u8005\u8bbe\u7f6e\u4e00\u4e2a\u5143\u7d20\u7684innerHTML\uff08\u8fd9\u4e2a\u662f\u6a21\u4effjQuery\u91cc\u9762\u7684html()\u65b9\u6cd5\uff09\uff0c\u8fd8\u4e00\u4e2a\u65b9\u6cd5\u662f\u628a\u4e00\u4e2a\u8868\u5355\u5bf9\u8c61\u8f6c\u6210hash\u5bf9\u8c61\uff0c\u7528\u5f97\u6bd4\u8f83\u5c11\u4e00\u70b9\u3002 \u65b9\u6cd5\uff1ahtml \u8bf4\u660e\uff1a\u5f53\u53c2\u6570\u4e0d\u4e3a\u7a7a\u65f6\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u5143\u7d20\u7684innerHTML\uff0c\u5f53\u53c2\u6570\u4e3a\u7a7a\u65f6\uff0c\u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684innerHTML\u3002 Element.implement({ html: function(s) { \/\/\/&lt;summary&gt; \/\/\/ \u83b7\u53d6\u5143\u7d20\u7684HTML\u5185\u5bb9\u6216\u8005\u8bbe\u7f6e\u5143\u7d20\u7684HTML\u5185\u5bb9 \/\/\/&lt;\/summary&gt; \/\/\/&lt;param name=&quot;s&quot; type=&quot;String&quot;&gt;\u53c2\u6570\u4e3a\u7a7a\u65f6\uff0c\u83b7\u53d6HTML\u5185\u5bb9\uff1b\u53c2\u6570\u4e3a\u5b57\u7b26\u4e32\u65f6\uff0c\u8bbe\u7f6eHTML\u7684\u5185\u5bb9&lt;\/param&gt; \/\/\/&lt;returns type=&quot;String&quot; \/&gt; if (s === undefined) { return this.get(&#8216;html&#8217;); } else { this.set(&#8216;html&#8217;, s + &#8221;); return s; } } }); \u65b9\u6cd5\uff1atoHash \u8bf4\u660e\uff1a\u628a\u4e00\u4e2a\u8868\u5355\u5bf9\u8c61\u8f6c\u6362\u6210\u4e3a\u4e00\u4e2aHash\u5bf9\u8c61\uff0c\u65b9\u4fbf\u9a8c\u8bc1\u5904\u7406\u3002 Element.implement({ toHash: function() { \/\/\/&lt;summary&gt; \/\/\/ \u628a\u4e00\u4e2a\u8868\u5355\u8f6c\u6210Hash\u5bf9\u8c61 \/\/\/&lt;\/summary&gt; \/\/\/&lt;returns type=&quot;Hash&quot; \/&gt; return this.toQueryString().toHash(); } });<\/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":[120,104,328],"class_list":["post-667","post","type-post","status-publish","format-standard","hentry","category-coding","tag-AJAX","tag-JavaScript","tag-mootools"],"views":6523,"_links":{"self":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/comments?post=667"}],"version-history":[{"count":0,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/667\/revisions"}],"wp:attachment":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/media?parent=667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/categories?post=667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/tags?post=667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}