Get item from an array with jQuery

0

I have the following structure:

[{tabela: 'tabela1', coluna: 'coluna1'}, {tabela: 'tabela2', coluna: 'coluna2'}]

I need to enter this data within div in the format:

  

[TABLE.COLUMN]

In case it would stay:

  

[table1.column1] [table2.column2]

But I'm not finding a solution to this with jQuery . How could I do that?

    
asked by anonymous 08.09.2016 / 16:39

1 answer

3

Hello, my friend, I hope to help with your doubts.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script><script>$(document).ready(function(){varjson=[{tabela:'tabela1',coluna:'coluna1'},{tabela:'tabela2',coluna:'coluna2'}];$.each(json,function(index,value){$('#conteudo').append('index='+index+'-'+value.tabela+'-'+value.coluna+'</br>');});});</script><divid="conteudo"></div>
    
08.09.2016 / 16:50