2011-08-24 95 views
2

我使用谷歌的地方和jQuery实现了一旦用户开始在输入字段中输入的目标,它会调用谷歌的地方,并在下拉菜单中输入结果(通过jQuery UI自动完成)使用谷歌地方API与jQuery自动完成

我的问题是,在我的自动完成功能我有

source: function(request, response) { 
initialize() 
} 

在那里,我想调用这个函数

function initialize() { 
service.search(request, callback); 
} 

工作正常...但问题是...初始化会调用函数callback()...所以我不确定如何监听回调完成的时间。

因此,例如,我会做什么在这里:

source: function(request, response) { 
// need code here to know when initialize and callback are done and are sending me the list of results from google ? 
} 

我只是不知道如何等待谷歌的地方得到完成,以前我用$ .MAP从结果产生下拉。

回答

相关问题