Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Phonegap Xml to Json Example
<?xml version="1.1" encoding="utf-8"?>
<employees>
<employee>
<name>Abc</name>
</employee>
<employee>
<name>Xyz</name>
</employee>
</employees>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="jquery.js"></script>
<script src="lib/jquery.xml2json.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript">
function readXml(){
$.get('data.xml', function(xml){
var employees = $.xml2json(xml);
console.log(employees)
alert(employees.employee[0].name);
});
}
</script>
</head>
<body>
<button onclick="readXml()">Read Xml</button>
</body>
</html>a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.