I would like to create a search box that returns google auto tips from different countries. I found this great example of recreating an autocomplete search:
http://jsfiddle.net/XxTuA/2/
var suggestCallBack; // global var for autocomplete jsonp $(document).ready(function () { $("#search").autocomplete({ source: function(request, response) { $.getJSON("http://suggestqueries.google.com/complete/search?callback=?", { "hl":"en", // Language "jsonp":"suggestCallBack", // jsonp callback function name "q":request.term, // query term "client":"youtube" // force youtube style response, ie jsonp } ); suggestCallBack = function (data) { var suggestions = []; $.each(data[1], function(key, val) { suggestions.push({"value":val[0]}); }); suggestions.length = 5; // prune suggestions list to only 5 items response(suggestions); }; }, }); });
but I canβt figure out how to limit it to a specific country, and there seems to be no documentation about the parameters that can be passed to google auto.
If anyone has suggestions on how to do this, that would be great. Thanks!
source share