开发者

jquery autocomplete array help

开发者 https://www.devze.com 2023-02-03 10:59 出处:网络
开发者_开发技巧Hey all i am trying to use my already array that i populated into the jQuery Source:
开发者_开发技巧

Hey all i am trying to use my already array that i populated into the jQuery Source:

$(document).ready(function(){
    $("input#partSearchBox").autocomplete({
        source: [partNum]
    });
});

the partNum looks like this:

gh3423645,jh324332,iu45233,gk324456, etc etc...

And i can get to each data by doing this:

partNum[0] or partNum[3], etc...

How can i already use that array within the source? The code i posted above has no suggestions once i start typing?

Thanks!

David


Since partNum is already an array, try using

source: partNum

instead of source: [partNum].

0

精彩评论

暂无评论...
验证码 换一张
取 消