$('everybody').hello(); could someone please tell me what is wrong with this json? :(
[ { 'id': '17', 'nome': 'foto', 'autore': 'username', 'tipo': 'foto', 'data_ins': '1202210415', 'numero_files': '4', 'tags': 'tags; tags; tags; tags' }, { 'fileObj': [ { 'id': '21', 'filename': '1202210415_0.jpg', 'alias': 'foto 1', 'tags': '', 'autore': '1', 'data_ins': '1202210419' }, { 'id': '22', 'filename': '1202210415_1.jpg', 'alias': 'foto 2', 'tags': '', 'autore': '1', 'data_ins': '1202210419' } ] } ] this is the response I get from a $.post call (it actually calls a php script that I wrote, so I can change it). it's about some media galleries. it is (meant to be) an array of two objects. first object should be tre gallery which the user wants to browse. second object is an array that contains other objects, each being a single file contained in that particular gallery. the problem is that I can't retrieve any data from this response... I thought that this would work $.post('script.php', {'gall_id': 17}, function(data){ var gallery = data[0]; var files = []; files = data[1]; and then I could access all the properties, like: gallery.id gallery.data_ins or files.fileObj[1].filename but this doesn't work at all. I get errors such gallery.id is not defined... $('everybody').is(':reader').each(function(){ $(this).thank(); if ($(this).is(':helper')) $(this).getBeers(); });