-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path解析xml.html
More file actions
31 lines (29 loc) · 720 Bytes
/
Copy path解析xml.html
File metadata and controls
31 lines (29 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
loadXML=function(xmlFile){
var xmlDoc;
//IE浏览器
if(window.ActiveXObject){
xmlDoc=new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async=false;
xmlDoc.load(xmlFile);
//支持火狐浏览器
}else if(document.implementation && document.implementation.createDocument){
xmlDoc=document.implementation.createDocument(",",null);
xmlDoc.load(xmlFile);
}else{
return null;
}
return xmlDoc;
}
var x=loadXML('test2.xml');
var v = x.getElementsByTagName('Login/Weapon/W')[0].childNodes.getAttribute('Text');
</script>
</body>
</html>