So, here\'s the deal: I have a JSON object saved in my web App at localStorage.
This JSON is being saved as a string, with JSON.stringify
, inside one of my function
You don't need the transform for this, try it this way:
var jsonData = $.parseJSON(window.localStorage.getItem("data"));
var $select = $('#mySelectID');
$(jsonData).each(function (index, o) {
var $option = $("").attr("value", o.CODE).text(o.NAMEVAR);
$select.append($option);
});
Here is a working fiddle.