vimeo에서 xml 피드를로드해야합니다. 다음과 같이 jquery를 사용하고 있습니다.jQuery를 사용하여 다른 도메인에서 XML 피드를로드하는 중 XMLHttpRequest 오류를 수정하는 방법?
$(function(){
// Get vimeo feed
$.ajax({
type: "GET",
url: "http://vimeo.com/api/v2/<my username>/videos.xml",
dataType: "xml",
success: function(xml) {
$(xml).find("video").each(function() {
console.log($(this).find("title"));
});
}
});
});
하지만이 오류가 발생합니다. XMLHttpRequest는 http://vimeo.com/api/v2/ /videos.xml을로드 할 수 없습니다. Origin http://localhost:8888은 Access-Control-Allow-Origin에서 허용되지 않습니다.
차이가 있다면 MAMP를 사용하고 있습니다.
([동일 출처 정책을 우회하는 방법]의 중복 가능성 http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same- origin-policy) – redsquare