views:

73

answers:

2
$.get('data/animals.xml', function(xml){
var animals = $.xml2json(xml);
alert(animals.dog[1].name +'/'+ animals.dog[1]);
});

the code below runs very well for http://www.fyneworks.com/jquery/xml-to-json/data/animals.xml

but how can get rate data from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml according to code block above..

?

ref: http://www.fyneworks.com/jquery/xml-to-json/#tab-Usage ref 2( the propose: ) :http://stackoverflow.com/questions/3629042/getting-data-using-javascript

+1  A: 

Try one of the options specified in this link

Vinay B R
+1  A: 

Try the following. I've tested it on FF 3.6 and Chrome 6, it works.

$.get('data/eurofxref-daily.xml', function(xml) {
      var jsonObj = $.xml2json(xml);
      alert(jsonObj.Cube.Cube.Cube[0]["rate"]);
}); 
Zafer
@Zafer, Thanks Sir! with this question, i have discovered www.sordu.com too!Regards..
blgnklc
You're welcome :).
Zafer