dimanche 31 décembre 2017

Return a view with data after ajax call

I'm using Laravel 5.5 and jQuery.

I'm trying to return a view after an ajax call but with data and I don't find the solution.

JS:

$('#button-recommandations').on('click', function () {
    $.ajax({
        method: 'GET',
        url : 'recommandationsSeances',
        data : {
           'idSeance' : $(e.relatedTarget).data('seance')
        },
        xhrFields: { withCredentials: true },
        crossDomain : true
    });
});

PHP:

return view('listeRecommandations', [
     'recommandationAutresActiviteMemeDateHeure' => $recommandationAutresActiviteMemeDateHeure,
     'recommandationsMemeActiviteMemeHeure'      => $recommandationsMemeActiviteMemeHeure,
     'recommandationsMemeActiviteMemeDate'       => $recommandationsMemeActiviteMemeDate
]);

It is possible?

Thank's for help!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lA0gXx
via IFTTT

Aucun commentaire:

Enregistrer un commentaire