¿Alguna solución?
Código Javascript:
Ver original
function commentsResult(url, page) { $.ajax({ url: url, type: "POST", data: {page : page }, dataType: "JSON", beforeSend: function( xhr ) { $('#call-comment-ajax').html('cargando...'); }, async: false, success: function( data ) { var html; var xhrdata = data.comments; var xhrchildren = data.children; var xhrpage = data.page; $.each(xhrdata, function(key, value){ html = '<div class="wall-comment">\ <div class="wall-comment-1">\ foto\ </div>\ <div class="wall-comment-2">\ <b>micho</b>\ <br/>'+value.message+'\ </div>\ <div class="wall-comment-3">\ me gusta | comentar | hace 3 min \ </div>\ <div class="children">'+ responseResult(value.id)+'</div>\ </div>'; $('.call-comment-ajax').fadeIn('slow').append(html); }); // $('.children').fadeIn('slow').append(html); $('#url-page-wall').attr('value', xhrpage); } }); };
Código Javascript:
Ver original
function responseResult(id) { var html $.ajax({ url: '{{url('user_wall_children')}}', type: "POST", data: {id : id }, dataType: "JSON", beforeSend: function( xhr ) { $('#call-comment-ajax').html('cargando...'); }, async: false, success: function( data ) { //return data.children; var xhrdata = data.children; if(typeof data!="undefined"){ $.each(xhrdata, function(key, value){ html += value.message; //html = $('.children').append(value.message+'<br/>'); //return value.message; }); } } }); return html; }