Filtering from a file to show information
Since you are using jquery, you can use its built in each function to loop through the json results, which will eliminate the need for the size function.
i = index, v = values
$.each(data,function(i,v){
   $(&quot;#list_box&quot;).append(&quot;&lt;option value='&quot;+v.idgrupo+&quot;'&gt;&quot;+v.nome+&quot;&lt;/option&gt;&quot;);
})