I'm getting a JSON list thanks to this function :
$(document).ready(function () {
var idContact = @ViewData["IdPhysique"];
var Url = "/Accueil/DonneListeFonctionContact";
$.getJSON(Url, { IdContact: idContact }, function (data) {
});
});
And I get this JSON:
Now I would like to parse that JSON to an array so I did this:
$(document).ready(function () {
var idContact = @ViewData["IdPhysique"];
var Url = "/Accueil/DonneListeFonctionContact";
var data = $.getJSON(Url, { IdContact: idContact }, function (data) {
});
var array = JSON.parse(data);
});
But an error appears in Google development tool:
Uncaught SyntaxError: Unexpected token o
Is there an other way to do that ?