使用代码段
时,我从下面的代码中获得了引用错误它在行号11(变更请求)附近说错误
我很想知道如何让它无错误
function getAddress() {
var siteUrl = $('#siteUrl').val();
var geocoder = new google.maps.Geocoder();
var county_text = $('#adv_county').val();
var postal_code = $('#adv_postcode').val();
county_text = county_text ? county_text + ',' + postal_code : postal_code;
if (!county_text) {
return false;
}
$('.addressfields').val('');
var request = {
address: county_text,
componentRestrictions: {
country: 'UK'
}
};
}
$('#adv_county,#adv_postcode').change(function () {
getAddress();
});
function initialize() {
var adv_county_input = document.getElementById('adv_county');
var postcode_input = document.getElementById('adv_postcode');
var options = {
//types: ['address'],
componentRestrictions: {
country: 'uk'
}
};
var autocomplete_county = new google.maps.places.Autocomplete(adv_county_input, options);
var autocomplete_postcode = new google.maps.places.Autocomplete(postcode_input, options);
}
感谢您的回复