Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript GETJson将两个参数传递给服务器_Javascript_Jquery - Fatal编程技术网

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 );
试试上面的鳕鱼。这应该是因为您没有使用数据函数访问它