TypeError:显示a为null?

时间:2014-04-23 12:27:30

标签: jquery ajax

Google地图自动完成功能无效。显示类型错误:a为空错误。 这是我的代码:

    <div class="input-wrapper">
      <input id="location" style="width: 350px;" class="location" type="text"
       value="<?php echo translate("Where_do_you_want_to_go"); ?>" name="location" 
       autocomplete="off" onblur="if (this.value == ''){this.value = '<?php echo translate("Where_do_you_want_to_go"); ?>'; }"
       onfocus="if (this.value == '<?php echo translate("Where_do_you_want_to_go"); ?>') {this.value = ''; }"
       placeholder="<?php echo translate("Where_do_you_want_to_go"); ?>">
      <p id="enter_location_error_message" class="bad" style="display:none;">&#10; Please set location&#10; </p>
</div>

这是我的jQuery:

$(document).ready(function () {

  var input = document.getElementById('location');
  autocomplete = new google.maps.places.Autocomplete(input);    
  google.maps.event.addListener(autocomplete, 'place_changed', function() {

  });
});

我试图解决这个问题。

0 个答案:

没有答案