2
I have an ajax function that consumes a webservice ,and returns me a list, as I take this list and mount two arrays with the values?
JS:
function getCars() {
$.ajax({
type: "POST",
url: "CarService.asmx/GetAllCars",
data: "MethodName=GetAllCars",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
//QUERO MONTAR OS ARRAYS AQUI
});
},
failure: function(msg) {
$('#output').text(msg);
}
});
}
I want to take the return of this list and put together two arrays. Ex: the list returns 5 records, with ID, value, and car color. I want to mount two arrays, one for color and one for Ex value:
var cor = [];
var valor = [];
I want to fill in the 3 records returned in the list, IE, 3 colors and 3 value, getting
cor['red','blue','blue']
valor ['20.5','30.5','50.5']
Only that.
that i, is the Indice? another question, can I declare the arrays outside the function to be ultimalized in any other?
– War Lock
That’s right. Yes, take a look in that reply! @Warlock
– Lucio Rubens
Thanks lucius, this answers my other topic that I think was misunderstood, see http://answall.com/questions/80970/grafico-highcharts-com-webservice answers there, because there would be in practice, obg :)
– War Lock