I have a function which is like
$(function() {
var data = [
{ label: "anders", category: "" },
{ label: "annhhx10", category: "Products" },
{ label: "annk K12", category: "Products" },
{ label: "andreas johnson", category: "People" }
];
$( "#search" ).catcomplete({
delay: 0,
source: data
});
});
I want to pass all the labels in the “data[]” array from an external file which has around 1000 Entries instead of having them in the source file. Please guide me to achieve this.
Well, one option would be to do the following: