一般来说,我对编码是个新手。
我一直在拿
"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_。