I have a php file wich searches in a DB, then builds and array with results and it ends and shows the result like this:
{"1":"1","2":"2","15":"15","25":"25"}
That means in position 0 there is no result, position 1 has value 1, and so on. (as far as I /know this result is a valid json output)
In jquery side I have this
$.ajax({
type: 'POST',
url: 'diahoracierre.php',
dataType: 'json',
cache: false,
success: function(result) {
alert(result);
},
});
What I need is to "parse" result to an array and be able to play which the content using index of array, like
alert(result[X]);
on result[1] it shows 1, any other attempt shows undefined and there are at least 4 results.
resultand notmyArray, I have no idea why this isn't working