var jj = []; $('.pageblock').each(function(i,elem) { jj[i] = { name: $(elem).find('.name').val(), age: $(elem).find('.age').val() } }); myJson = JSON.stringify(jj); I collect all downloaded names and ages from the screen, collect them in json and send them to the server:
$.ajax ({ type: "POST", url: 'kernel.php?cmd=savearticle', dataType: 'json', async: false, data: myJson, success: function (data) { console.log(data) } }) in php script just trying to return the received
print_r( $_POST['data'] ); What I do wrong does not return anything. Who will tell?