var ArrayData = $.map($('#TheData').text().split(','), function(value){
return parseInt(value, 10);
// or return +value; which handles float values as well
});
You can use $.map
to transform the array of strings to ints by calling parseInt
on each of the elements in the array