foursquare OAuth URL에 대한 GET 호출을하고 있습니다. 브라우저 콘솔은 여기에 다음과 같은 오류를Foursquare는 'No access control allow origin'헤더 오류를 표시합니다.
XMLHttpRequest cannot load https://foursquare.com/oauth2/authenticate?client_id=DF4I1TGNVHAM40PDLOHZQZ…onse_type=code&redirect_uri=http://localhost:9000/auth/foursquare/callback. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9000' is therefore not allowed access.
를 인쇄 호출하는 코드 조각입니다 :
$http.get(url).success(function(data,status,headers,config){
});
하지만이 URL에 단추를 연결하는 경우, 브라우저는 인증 페이지에 저를합니다.
어떤 차이가 있습니까? 왜 URL이 버튼에 링크되어 있고 그 URL에 대한 GET 호출이있을 때 작동하지 않는 이유는 무엇입니까?
CORS에 대해 읽으십시오. 이 경우 AJAX를 사용할 수 없습니다. – dfsq