dimanche 2 décembre 2018

how to create ajax in laravel

i want to show my data when i click button with ajax.

here ajax that i try.

  $(document).ready(function(){
    $(document).on('click', '#detailptr', function(){
       var idpartner = $(this).data("vid");
       $('#detailptr').html("Loading...").prop("disabled", true);
       $.ajax({
          url:""+idpartner,
          method:"GET",
          data:{idpartner:idpartner},
          dataType:"text",
          success:function(data)
          {
             if(data != '')
             {
                //$('#remove_row').remove();
          $("#remove_row").html(data);
             }
             else
             {
                //$('#detailptr').html("Sudah Semuanya");
             }
          }
       });
    });
  });

my html

<a type="button" data-toggle="collapse" data-target="" data-vid="" id="detailptr"></a>

and this is my route

Route::get('/partnere/{id}', 'Front\Home\FrontController@employeeajax')->name('front.partnereemployee');

when i try to run, it always show me

Missing required parameters for [Route: front.partnereemployee] [URI: partnere/{id}]



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire