Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 获取google places自动完成状态_Javascript_Google Places Api - Fatal编程技术网

Javascript 获取google places自动完成状态

Javascript 获取google places自动完成状态,javascript,google-places-api,Javascript,Google Places Api,如何在google places自动完成搜索中获取状态。。如果我在google places autocomplete文本框中键入一些内容,而这些位置不在那里,那么如何发出位置无效的警报?我认为您可以使用类似的方法 var displaySuggestions = function(predictions, status) { if (status != google.maps.places.PlacesServiceStatus.OK) { alert(status); r

如何在google places自动完成搜索中获取状态。。如果我在google places autocomplete文本框中键入一些内容,而这些位置不在那里,那么如何发出位置无效的警报?

我认为您可以使用类似的方法

var displaySuggestions = function(predictions, status) {
  if (status != google.maps.places.PlacesServiceStatus.OK) {
    alert(status);
    return;
  }

我想你可以用这样的东西

var displaySuggestions = function(predictions, status) {
  if (status != google.maps.places.PlacesServiceStatus.OK) {
    alert(status);
    return;
  }