{"id":237831,"date":"2022-03-29T09:29:47","date_gmt":"2022-03-29T01:29:47","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=237831"},"modified":"2022-03-16T10:38:01","modified_gmt":"2022-03-16T02:38:01","slug":"dom-browser-differences","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/dom-browser-differences.html","title":{"rendered":"XML DOM \u6d4f\u89c8\u5668\u5dee\u5f02\u6982\u8ff0"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e0d\u540c\u7684\u6d4f\u89c8\u5668\u5728 XML DOM \u4e2d\u5904\u7406\u7a7a\u6587\u672c\u8282\u70b9\u7684\u65b9\u5f0f\u662f\u4e0d\u540c\u7684\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

DOM \u89e3\u6790\u4e2d\u7684\u6d4f\u89c8\u5668\u5dee\u5f02<\/strong><\/div>\n

\u6240\u6709\u73b0\u4ee3\u7684\u6d4f\u89c8\u5668\u90fd\u652f\u6301 W3C DOM \u89c4\u8303\u3002<\/p>\n

\u7136\u800c\uff0c\u6d4f\u89c8\u5668\u4e4b\u95f4\u662f\u6709\u5dee\u5f02\u7684\u3002\u4e00\u4e2a\u91cd\u8981\u7684\u5dee\u5f02\u662f\uff1a<\/p>\n

\u5904\u7406\u7a7a\u767d\u548c\u6362\u884c\u7684\u65b9\u5f0f<\/p>\n

DOM - \u7a7a\u767d\u548c\u6362\u884c<\/strong><\/div>\n

XML \u7ecf\u5e38\u5728\u8282\u70b9\u4e4b\u95f4\u5305\u542b\u6362\u884c\u6216\u7a7a\u767d\u5b57\u7b26\u3002\u8fd9\u662f\u5728\u4f7f\u7528\u7b80\u5355\u7684\u7f16\u8f91\u5668\uff08\u6bd4\u5982\u8bb0\u4e8b\u672c\uff09\u7f16\u8f91\u6587\u6863\u65f6\u7ecf\u5e38\u51fa\u73b0\u7684\u60c5\u51b5\u3002<\/p>\n

\u4e0b\u9762\u7684\u4f8b\u5b50\uff08\u7531\u8bb0\u4e8b\u672c\u7f16\u8f91\uff09\u5728\u6bcf\u884c\u4e4b\u95f4\u5305\u542b CR\/LF\uff08\u6362\u884c\uff09\uff0c\u5728\u6bcf\u4e2a\u5b50\u8282\u70b9\u4e4b\u524d\u5305\u542b\u4e24\u4e2a\u7a7a\u683c\uff1a<\/p>\n

<book>\r\n<title>Everyday Italian<\/title>\r\n<author>Giada De Laurentiis<\/author>  \r\n<year>2005<\/year>   \r\n<price>30.00<\/price>\r\n<\/book><\/pre>\n

Internet Explorer \u5c06\u4e0d\u4f1a\u628a\u7a7a\u7684\u7a7a\u767d\u6216\u6362\u884c\u4f5c\u4e3a\u6587\u672c\u8282\u70b9\uff0c\u800c\u5176\u4ed6\u6d4f\u89c8\u5668\u4f1a\u3002<\/p>\n

\u4e0b\u9762\u7684\u4ee3\u7801\u7247\u6bb5\u663e\u793a\uff08books.xml \u7684\uff09\u6839\u5143\u7d20\u62e5\u6709\u591a\u5c11\u4e2a\u5b50\u8282\u70b9\uff1a<\/p>\n

\u5b9e\u4f8b<\/strong><\/p>\n

xmlDoc=loadXMLDoc(\"books.xml\");\r\nx=xmlDoc.documentElement.childNodes;\r\ndocument.write(\"Number of child nodes: \" + x.length);<\/pre>\n

\u5b9e\u4f8b\u89e3\u91ca\uff1a<\/p>\n

    \n
  1. \u4f7f\u7528 loadXMLDoc() \u628a \"books.xml\" \u8f7d\u5165 xmlDoc \u4e2d<\/li>\n
  2. \u83b7\u53d6\u6839\u5143\u7d20\u7684\u5b50\u8282\u70b9<\/li>\n
  3. \u8f93\u51fa\u5b50\u8282\u70b9\u7684\u6570\u91cf\u3002\u7ed3\u679c\u53d6\u51b3\u4e8e\u60a8\u6240\u4f7f\u7528\u7684\u6d4f\u89c8\u5668\u3002IE \u6d4f\u89c8\u5668\u4f1a\u8f93\u51fa 4\uff08\u63d0\u9192 4 \u4e2a\u5b50\u8282\u70b9\uff09\uff0c\u800c\u5176\u4ed6\u6d4f\u89c8\u5668\u4f1a\u8f93\u51fa 9\uff08\u63d0\u9192 9 \u4e2a\u5b50\u8282\u70b9\uff09\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

    \u6240\u6709\u73b0\u4ee3\u7684\u6d4f\u89c8\u5668\u90fd\u652f\u6301 W3C DOM \u89c4\u8303\u3002 \u7136\u800c\uff0c\u6d4f\u89c8\u5668\u4e4b\u95f4\u662f\u6709\u5dee\u5f02\u7684\u3002\u4e00\u4e2a\u91cd\u8981\u7684\u5dee\u5f02\u662f\uff1a \u5904\u7406\u7a7a\u767d\u548c\u6362\u884c […]<\/p>\n","protected":false},"author":1481,"featured_media":237833,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-237831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1481"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=237831"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237831\/revisions"}],"predecessor-version":[{"id":237835,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237831\/revisions\/237835"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/237833"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=237831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=237831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=237831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}