I have this code. And i want to put id as dynamic value to parameter of route. But i can't get the value of id i get only text id
i try these code:
var id = $(this).data('studentid');
var br_id = "{{ route('dep', ['student_id' =>"+id+"])}}";
$.ajax({
url: br_id,
type: "GET",
success: function (data) {
$('.replace').html(data);
//alert('hello')
},
error: function (jQXHR, textStatus, errorThrown) {
console.log(jQXHR);
console.log(textStatus);
console.log(errorThrown);
}
}); //end Ajax
and i get the below result:
http://localhost/library/public/dep/+id+
i want to show the id from select that is dynamic data and i want to put it in this parameter of route.Any solution for these?