我的 javascript 上有这段代码:
function getListOfPOI() {
geocoder = new google.maps.Geocoder();
var address = document.getElementById('tbCity').value;
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var request = {
location: results[0].geometry.location,
radius: 8000,
types: all //['store']
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
return true;
}
我用下面的按钮调用这个函数:
<asp:Button ID="btnAddCity" Height="20px" Text="Add" runat="server" OnClientClick="return getListOfPOI();" OnClick="btnAddCity_Click" UseSubmitBehavior="false" />
OnClientClick 完美运行,但未触发 OnClick 函数。我应该怎么办?提前感谢您的见解。
干杯,妮莎