Ho alcuni JSON (var data
) che assomiglia a questo:jQuery loop through json?
{"success":"true","keywords":["firstkeyword","secondkeyword"]}
E nel tentativo di collegare attraverso le parole chiave utilizzando questo codice:
data.keywords.each(function(e){
$('#campaign_keywords').append("<p>"+e+"</p>");
});
ma ho l'errore di
Uncaught TypeError: Object firstkeyword,secondkeyword has no method 'each'
Basta usare 'v' per accedere ai valori. – Shef