var autocomplete = new google.maps.places.Autocomplete(input, optionsAuto);
google.maps.event.addDomListener(window, 'load', function(){
//get the autocomplete input value here
//I want to use autocomplete.getPlace() here
});
我可以使用' place_changed'侦听器传递自动完成对象,但在刷新页面时无法获取值。
答案 0 :(得分:0)
尝试使用javascript DOMContentLoaded
document.addEventListener( "DOMContentLoaded", function(){
//get the autocomplete input value here
//I want to use autocomplete.getPlace() here
});