I'm writing a currency exchange widget and i can't get how to parse data from this xml: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
Here's my code:
jQuery('#value_from').on('keyup', function() {
var data = this.value;
var curr = document.getElementById('curr_from').value;
jQuery.ajax({
type: "GET",
url: "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml",
dataType: "xml",
success: function(xml) {
jQuery(xml).find('Cube').each(function(){
var data = jQuery(this).attr('currency');
console.log(data);
});
}
});
document.getElementById('value_to').value = '\u20AC ' + data;
});
console.log(xml)
reveal? – Álvaro Gonzálezconsole.log(xml)
? – Álvaro González