[英]How do you debug a request
您如何调试请求? 像下面的代码。 这是javascript。 而且我正在穿越萤火虫。 但是我什么也没穿
if (status == google.maps.GeocoderStatus.OK)
检查状态。 这样电话就响了。 一无所有。 有人如何调试呢? 还有其他获取错误代码的方法吗?
谢谢
function codeAddress() {
geocoder = new google.maps.Geocoder();
service = new google.maps.DistanceMatrixService();
var address = document.getElementById("storeAddress").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
storeGeo = results[0].geometry.location;
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
您可以使用wireshark来检查是否将请求发送到接口,也可以将GET-URL字符串XESSION_XDEBUG_START附加到URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.