I´m having a problem retrieving a value from a XML file. I have an alert which gives me the expected value but when I try to return the value, it returns NaN. Thanks in advance.
function GetNumberOfSales(fixedScenario) {
var result;
$.ajax({
type: "GET",
url: "values.xml",
dataType: "xml",
success: function (xml) {
$(xml).find("values").each(function () {
alert($(this).find(fixedScenario).text());
result = $(this).find(fixedScenario).text();
});
}
});
return result;
}