HTML5地理位置地址表单填充器未捕获语法错误:意外的标记<

HTML5 GeoLocation Address Form Filler Uncaught SyntaxError: Unexpected token <

本文关键字:意外 lt 错误 语法 表单 地址 地理位置 填充 HTML5      更新时间:2023-09-26

一般来说,我对编码是个新手。

我一直在拿

"Uncaught SyntaxError:意外的令牌<"错误,我不知道出了什么问题。

xhr.open("GET", url);
xhr.onload = function() {
  //if we make a successful request and it returns an address
  if(this.status==200 && JSON.parse(xhr.responseText).contents.results.length > 0){
    //get formatted address from https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding
    var result = JSON.parse(xhr.responseText).contents.results[0].formatted_address;
    putInDom(result);
  } else {
    //send some general error
    info.innerHTML = "Could not find your location.";
  }
}

这是我获取zip文件的地方。我感谢所有的帮助。非常感谢。http://techslides.com/html5-geolocation-address-form-filler

看起来您的响应是HTML,而不是JSON。因此CCD_ 1在CCD_ 3令牌上抛出CCD_。