Global location input autocomplete

99封情书 提交于 2019-12-01 22:05:09

What is your data source of locations? If it is geonames.org, they have different geographies on different servers - with different performance characteristics. Hence it is common on a worldwide search to see jerks, odd responses, etc. as different servers toss back at different times. I found that user selection of a country, and feeding that into the city query pretty much eliminates jerkiness, odd responses, etc. If you are using geonames.org, they require attribution at the search box. If you are using a google data source of names, I can't comment, but you might check how they handle major versus minor countries. Also, think about the level of detail provided. Geonames is remarkable on that score.

There is a widget that does that, the jquery ui autocomplete.

http://jqueryui.com/demos/autocomplete/#remote-jsonp

This demo is exactly what you need, selecting locations over the world

Hope this helps. Cheers

If the problem is related to the highlighting you might want to check the success section of your ajax call and make sure that you are un-highlighting in the right moment. Because the section is always changing it might glitch at one point given the nature of bringing back lots of info and altering dynamically

hope this helps!

ps. autocomplete jQuery will autocomplete anything it feeds from

OSClass.org provides its theme for free which has location autocomplete with all areas being populated automatically. This you can check in their demo and download the code from within their theme files. Demo (login and go to Settings->location section) : http://demo.osclass.org/general/oc-admin/index.php?page=login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!