Google プレイスに場所を追加しようとすると、次のエラーが表示されます。
{"readyState":0,"responseText":"","status":0,"statusText":"error"}
私のコードは次のとおりです。
HTML:
<form id="addShopForm">
...
<a type="submit" id="submitshop">Submit</a>
</form>
Jクエリ:
$('#submitshop').click(function(){
$.ajax({
type: "POST",
url: "https://maps.googleapis.com/maps/api/place/add/json?sensor=true&key=asdEFasdBaasdasdasdMrN2ST5tRS5c",
crossDomain: true,
data: {
"location": {
"lat": 68.7425471,
"lng": 9.1370879
},
"accuracy": 50,
"name": "Test Shop!",
"language": "de"
},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(JSON.stringify(msg));
},
error: function (errormessage) {
alert(JSON.stringify(errormessage));
//{"readyState":0,"responseText":"","status":0,"statusText":"error"}
}
});
});