Javascript 如何调试请求
如何调试请求? 就像下面的代码。 这是javascript。我正在穿越萤火虫。 但我从来没穿什么衣服Javascript 如何调试请求,javascript,google-maps,xmlhttprequest,status,Javascript,Google Maps,Xmlhttprequest,Status,如何调试请求? 就像下面的代码。 这是javascript。我正在穿越萤火虫。 但我从来没穿什么衣服 if (status == google.maps.GeocoderStatus.OK) 检查状态。 所以电话响了。什么也没有回来。 有人如何调试这个?是否有其他方法获取错误代码 多谢各位 function codeAddress() { geocoder = new google.maps.Geocoder(); service = new google.maps.Distanc
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字符串Xesession\u XDEBUG\u START附加到URL。查看网络面板,可能是错误控制台。或者,您也可以放置断点并通过javascript调试器单步执行代码