Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何调试请求_Javascript_Google Maps_Xmlhttprequest_Status - Fatal编程技术网

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

如何调试请求? 就像下面的代码。 这是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字符串Xesession\u XDEBUG\u START附加到URL。

查看网络面板,可能是错误控制台。或者,您也可以放置断点并通过javascript调试器单步执行代码