簡體   English   中英

GETJson 向服務器傳遞兩個參數

[英]GETJson pass two parameters to server

為什么在這段代碼中我只將“term”傳遞給服務器

$.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 );

試試上面的鱈魚。 應該是因為你沒有用data函數訪問

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM