如何在自动完成中将附加参数传递给 PHP 文件


how to pass additional argument to php file in autocomplete

我只想在自动完成中将参数传递给php.code如下

$(function(){
        $( "#txt_supplier_account_name" ).autocomplete(
        {
           source:'./modules/stock/ajax/ajax.commonsearch.php',
           select: function(event, ui) {
        }
   })
});

试试这个

$( "#txt_supplier_account_name" ).autocomplete(
    {
       source:'./modules/stock/ajax/ajax.commonsearch.php?key1=value1&key2=value2',
       select: function(event, ui) {
    }
});

通过source网址,您可以发送类似

$( "#txt_supplier_account_name" ).autocomplete(
    {
       source:'./modules/stock/ajax/ajax.commonsearch.php?key1='+value1+'&key2='+value2,
       select: function(event, ui) {
    }
});

ajax.commonsearch.php中,您可以通过网址GET