나는 텀블러의 어두운 세계의 깊이 탐구하기 위해 노력하고있어, 다음과 같은 오류 극복하는 방법을 이해할 수 없다 : 나는 그것을 할 수있다 생각JQuery와 아약스 - 텀블러의 API v2를
Uncaught SyntaxError: Unexpected token :
을 왜냐하면 나는 json을 되찾고 있지만 jsonp를 사용하려고하기 때문입니다. 여기에 내가 보내려고 내용은 다음과 같습니다
$(function(){
$.ajax({
type: "GET",
url : "http://api.tumblr.com/v2/blog/MyTumblrName.tumblr.com/info",
dataType: "jsonp",
data: {
api_key : "MyTumblrApi"
},
success: function(data){
console.log(data);
},
});
});
내가 얻을 200 OK 응답을, 데이터하지만 여전히 (이해가 안 등에 대해 알고 싶습니다)
위의 오류 Tumblr도 친절하게도 다음을 지적하지만 구체적인 내용은 분명하지 않습니다.
All requests made with HTTP GET are JSONP-enabled. To use JSONP, append jsonp= and the name of your callback function to the request. JSONP requests will always return an HTTP status code of 200 but will reflect the real status code in the meta field of the JSON response.
도움이 될 것입니다.
왜 jsonp에 관심이 있습니까? json 응답을 사용하십시오 ... –
JSON을 사용하는 경우 다음을 얻습니다. XMLHttpRequest는 http://api.tumblr.com/v2/blog/MYTUMBLRNAME.tumblr.com/info?api_key=APIKEY를로드 할 수 없습니다. Origin http : //.0.0.0.0:3000은 Access-Control-Allow-Origin에서 허용되지 않습니다. – Galaxy
아 맞아, 그 의미가있다 –