简体   繁体   English

您如何调试请求

[英]How do you debug a request

How do you debug a request? 您如何调试请求? Like the code below. 像下面的代码。 This is javascript. 这是javascript。 And I am running through firebug. 而且我正在穿越萤火虫。 But I never get anything on 但是我什么也没穿

 if (status == google.maps.GeocoderStatus.OK) 

To check the status. 检查状态。 So the call goes out. 这样电话就响了。 And nothing back. 一无所有。 How can someone debug this? 有人如何调试呢? Is there some other way to get an error code? 还有其他获取错误代码的方法吗?

thank you 谢谢

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM