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
most immediately you need to change this:
var jsonData = $.parseJSON(window.localStorage.getItem("data"));
var transform = {tag:'option', id:'.CODE',html:'{$NAMEVAR}'};
To this:
var jsonData = $.parseJSON(window.localStorage.getItem("MyData"));
var transform = {tag:'option', id:'{$CODE}',html:'{$NAMEVAR}'};
That's just a key to get to the data, so make sure you use the same key.
There may be some difficulty in rendering:
value="1"
As you are depending id="{$CODE}" to translate to that, which it will not do automatically.
Good luck!