谷歌api自动完成 [英] google api autocomplete

查看:117
本文介绍了谷歌api自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个建议文本框,例如 http://sindelantal.com/ [ ^ ]像他们一样使用google api。我一直在阅读它,但我无法在aspnet中进行...有没有人有一个例子或页面我可以了解更多?



谢谢你

解决方案

我找到了使用这个脚本的答案



 < span class =code-keyword><   script     type   =  text / javascript    src   =  http: //maps.google.com/maps/api/js?sensor=false&libraries=places&language=es\">  


(document).ready(function(){


var autocomplete = document.getElementById(&#39; ctl00_ContentPlaceHolder2_txtbuscar&#39;);
var options = {
// types:[&#39;(cities)&#39;],
componentRestrictions:{country:&#39; es&#39; }
};

autocomplete = new google.maps.places.Autocomplete(autocomplete,options);

}
< / script >


Hi, I want to make a suggest textbox like http://sindelantal.com/[^] using google api like they do. I''ve been reading about it, but I cant make it in aspnet...Does anybody has an example or a page where I can learn more?

thank you

解决方案

I found the answer using this script

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=es">


(document).ready(function() { var autocomplete = document.getElementById(&#39;ctl00_ContentPlaceHolder2_txtbuscar&#39;); var options = { //types: [&#39;(cities)&#39;], componentRestrictions: { country: &#39;es&#39; } }; autocomplete = new google.maps.places.Autocomplete(autocomplete, options); } )</script>


这篇关于谷歌api自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆