📜  带有链接的自动完成功能 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:46.337000             🧑  作者: Mango

代码示例1
var source = [ { value: "www.foo.com",
                 label: "Spencer Kline"
               },
               { value: "www.example.com",
                 label: "James Bond"
               },
               ...
             ];
             
             $(document).ready(function() {
    $("input#autocomplete").autocomplete({
        source: source,
        select: function( event, ui ) { 
            window.location.href = ui.item.value;
        }
    });
});