lundi 6 décembre 2021

Pass a laravel variable into a jquery array

I am trying to pass a variable into a jquery autocomplete script check this url (https://jsfiddle.net/duoc5bbh/1/) I found.

Laravel

@foreach($data as $value)
   
   
@endforeach

Jquery

$(function() {
  let users = [{
      "email": "marie@gmail.com",
      "name": "marie"
      }, 
      {
       "email": "miss@gmail.com",
       "name": "miss"
     }];
});

what I did

$(function() {
  let users = [{
      "email": ,
      "name": 
      }];
});

I am new in using laravel with jquery I need your help in this Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire