0
이봐, 난 나에게 오류를 제공합니다 코드 다음 한
"catch되지 않은 구문 에러를 : 예기치 않은 토큰"JSON 문제
내 코드 :
$.getJSON("http://maps.googleapis.com/maps/api/place/details/json?reference="+ref_tel+"&sensor=true&key=MY_API_KEY&callback=?",
function(data){
}, "json");
문제점은 무엇입니까?
P. JSON은 다음과 같습니다.
{
"html_attributions" : [],
"result" : {
"address_components" : [
{
"long_name" : "48",
"short_name" : "48",
"types" : [ "street_number" ]
},
{
"long_name" : "Pirrama Road",
"short_name" : "Pirrama Road",
"types" : [ "route" ]
},
{
"long_name" : "Pyrmont",
"short_name" : "Pyrmont",
"types" : [ "locality", "political" ]
},
{
"long_name" : "NSW",
"short_name" : "NSW",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "AU",
"short_name" : "AU",
"types" : [ "country", "political" ]
},
{
"long_name" : "2009",
"short_name" : "2009",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "5/48 Pirrama Road, Pyrmont NSW, Australia",
"formatted_phone_number" : "(02) 9374 4000",
"geometry" : {
"location" : {
"lat" : -33.8669710,
"lng" : 151.1958750
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "4f89212bf76dde31f092cfc14d7506555d85b5c7",
"international_phone_number" : "+61 2 9374 4000",
"name" : "Google Sydney",
"rating" : 4.60,
"reference" : "CnRlAAAAAfV6JIqSzL8Cf4VnXn0EaI1d5k3IPhdkEonq0MxiUbQFFSVuptVbXbNH4mrevb0bc7G8yWqTUv76i4KTuO_Wf3OrRHjCJJwzQ0mNLjbYGSVqy2eqyrgOUkl6S_sJfTbHzWZYrfPy7KZaet0mM5S6thIQJYuy5v_JD--ZxXEJLWTQRRoU5UaciXBBo89K-bce18Ii9RsEIws",
"types" : [ "store", "establishment" ],
"url" : "http://maps.google.com/maps/place?cid=10281119596374313554",
"vicinity" : "5/48 Pirrama Road, Pyrmont",
"website" : "http://www.google.com.au/"
},
"status" : "OK"
}
디버거가 오류 2를 표시합니다. 누군가 문제를 해결할 수 있습니까?
이것은 좋은 질문이 아닙니다. 오류에 대한 추가 정보가 있습니까? 아마 라인 번호는? 약간의 변경을하기 전에 작업을 했습니까? 그것은있을 수 있습니다? URL 끝에? –
? jquery가 JSONP 요청에 콜백 함수 이름을 추가하는 데 사용됩니다. – Fox32
firebug 또는 fiddler 또는 chrome 개발자 도구 – Rafay