loopj/jquery-tokeninput — Issue #276: Bug:Dynamic Source ,url is undefined@ 813 Line in src
Author: jaideep87
Created: 2012-02-11 13:22:16+00:00
State: open

I,m Trying To Use TokenInput plugin With GMAP3 jquery plugin avilable at http://gmap3.net/examples/address-lookup.html
for address lookup,
GMAP3 gives a dynamic response object which i transform to feed tokenInput Plugin ,But it seems to Fail to get returned data,
instead it prompt to make a ajax call rather than getting result object I have Tried Every Option .Here's the code

function googleFetch(settings){

var query = $('#token-input-location-select').val();
if(query != ''){
$("#test").gmap3({
action:'getAddress',
address:$('#token-input-location-select').val(),
callback:function(results){
if (!results) {return [];}
else{
var googleData=[];
$.each(results,function(i){
//alert(results[i].formatted_address); //Here is Data What I am Looking For
googleData.push({"name": results[i].formatted_address});
});
return googleData;}
}
});}
else return [];

}

$("#location-select").tokenInput(googleFetch,{,
tokenValue: "name",
onResult: function (data) {alert(data);}
});

on

it breaks at line 813 of jquery.tokeninput.js which says

if(url.indexOf("?") > -1) {

Please give Direction,Thanks