I have this code:
$.getJSON('../encomendasanexos.php?campo=idencomendas&nome=imagem&id='+id_int,
function(registro){
var imghtml = [];
imghtml = '<img src="icones/editar.png"
onclick="window.open(\'editImagem.php?
tabela=anexos&id='+registro.id+'&ordem='+registro.i+'\', \'_blank\', \'width=750,height=550,scrollbars=no,status=yes\' );" />';
$this.parent().find("#conteudoanexo").html(imghtml,join(''));
});
And the returned json:
[{"id":"400","img":"..\/imagens\/encomendas\/aspire_1309790504.jpg"},
{"id":"401","img":"..\/imagens\/encomendas\/casa_1309790507.jpg"},
{"id":"402","img":null}]
I wanna do a for loop with values received by json, where +registro.id+ is id and +registro.i+ is a key in 1st json array level.
demo at http://jsfiddle.net/gaby/GCzxS/1/