Different browsers parse XML differently

陈政宽~
Release: 2017-06-28 13:56:33
Original
4382 people have browsed it

The following code can be parsed in Firefox, but not in Google and IE. How should I modify the code? How to parse XML

The following code can be parsed in Firefox, but not in Google and IE. How should I modify the code? How to parse XML?
JScript code:

The code is as follows:


$("#result").append(xmlDoc.firstChild.localName + "


");
for ( var i = 0; i < xmlDoc.documentElement.childElementCount; i++) {
$("#result").append(
xmlDoc.documentElement.children[i].localName + "
");
}


Compatible with IE, Firefox, Chrome, Safari, Opera, etc. The code for the browser's XML file loading method is as follows. The xml file name is 1.xml.
XML code
XML code:

The code is as follows:




Mencius Chapter E's website
http://dotnet.aspx.cc/< ;/url>


Meng Xianhui’s blog
http://blog.csdn .net/net_lover/



HTML code
HTML code:

The code is as follows:




onload="loadXML()">






Name Website



The above is the detailed content of Different browsers parse XML differently. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template