Javascript GETJson将两个参数传递给服务器
为什么在这段代码中我只向服务器传递“术语”Javascript GETJson将两个参数传递给服务器,javascript,jquery,Javascript,Jquery,为什么在这段代码中我只向服务器传递“术语” $.getJSON( "{{route('search.index')}}", { term: request.term, type: $('#category_input').attr('data-type') }, response ); 多谢各位 $.getJSON( "{{route('search.index')}}", { te
$.getJSON( "{{route('search.index')}}", {
term: request.term,
type: $('#category_input').attr('data-type')
}, response );
多谢各位
$.getJSON( "{{route('search.index')}}", {
term: request.term,
type: $('#category_input').data('type')
}, response );
试试上面的鳕鱼。这应该是因为您没有使用数据函数访问它