external json
nobutsta opened this issue · 3 comments
nobutsta commented
Hello,
Is it possible to change from localData = []; into something like $.getJSON( "ajax/test.json", function( data ) {});
bseth99 commented
Yes, look at the docs (http://bseth99.github.io/jquery-ui-multisearch/index.html) for the source and ajaxOptions config options to setup a remote datasource
nobutsta commented
I've looked in it but it's not work. Here is what I did.
$('#multisearch').multisearch({
ajaxOptions: {
searchTerm: 'inc/phonebook.json.php',
dataType: 'json',
method: 'GET'
}
});
Please suggest.
bseth99 commented
The URL needs to be in the source options:
$('#multisearch').multisearch({
source: 'inc/phonebook.json.php',
ajaxOptions: {
searchTerm: 'name', /* or whatever your php script is expecting */
dataType: 'json',
method: 'GET'
}
});
That, in theory, should work.