I retrieve from my servlet the following data and i would like to store these data ["-1.2396853,52.7680791","-1.2396572,52.7682574","-1.2396083,52.7684203"] in the coords like below.
for example coords should be presented: var coords = [[-1.2396853, 52.7680791],[-1.2396572, 52.7682574],[-1.2396083, 52.7684203]];
$.ajax({
type: "GET",
url: "servlet",
success: function(data) {
var coordinates = JSON.parse(data).toString();
var coords = [];
var coords = coordinates.split(",");
}
});
any suggestion how i can do this?