Nosean
1 year ago

laravel jquery get variable into a $.getJSON Request

Posted 1 year ago by Nosean

Hey Guys,

I need your help. How do I pass a variable li.val () to the getJSON request??


 $('#selectCustomer')
        .editableSelect()
        .on('select.editable-select', function (e, li) {
            console.log(li.val());
            $.getJSON("{{ route('users.show', +li.val()+) }}", function (data) {
              console.log(data);
            });

            $('#user_name').val();
            $('#last-selected').html(
                li.val() + '. ' + li.text()
            );
        });

Thanks

Please sign in or create an account to participate in this conversation.