i am using jquery ajax in laravel for reading some data from database. i wrote this code and the $ajax() part not working! but every thing before that working great. what is wrong ?
$('#file_type').on('change',function(){
$value=$(this).val();
$.ajax({
type : 'get',
url : '{{URL::to('fileType.categories')}}',
data:{'file_type':$value},
success:function(data){
alert('ooooops1');
$('#file_type_cats').html(data);
}
});
});
$.ajaxSetup({ headers: { 'csrftoken' : '{{ csrf_token() }}' } });
my routes are OK. i'm using select element to run ajax. if i write alert($value); before $.ajax() it works good. but ajax not working.
update: solved i was using the route name which is wrong. i must use the url intself not the name!.