function setSourceUrl(url, query) {
var source = $('#inputSource').val();
var newurl = url + '?searchStr=' + query + '&type=' + source;
return newurl;
};
var remoteOpts = setBHRemoteOpts(false, '%QUERY', '/recipe/recipe/getSources', null);
var remoteOpts['replace'] = function(url, query) {return setSourceUrl(url, query);};
var bhOpts = setBHOptions(50, null, null, null, remoteOpts);
var sourceBH = new Bloodhound(bhOpts);
function initSourceTA() {
var options = initTypeaheadOptions(true,true,1);
var dataset = initTypeaheadDataset('source', null, 20, sourceBH);
$('.srcTA').typeahead(options,dataset);
};
这将返回匹配表或空结果。 (取1或0行)
如何发出SHOW TABLE LIKE 'my_table';
查询以获取" 0"或" 1" ?