Why in this code I only pass "term" to server
$.getJSON( "{{route('search.index')}}", {
term: request.term,
type: $('#category_input').attr('data-type')
}, response );
Thank you
$.getJSON( "{{route('search.index')}}", {
term: request.term,
type: $('#category_input').data('type')
}, response );
Try the cod above. It should be because you didn't access it with the data function
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.