$(document).ready(function(){
$.ajax({
url: “http://gdata.youtube.com/feeds/api/users/zdf/playlists?v=2“,
type: “GET”,
success: function(msg){
console.log(msg);
}
});
});
i get this error “XMLHttpRequest cannot load http://gdata.youtube.com/feeds/api/users/zdf/playlists?v=2“
How can i make crossdomain ajax calls to get the xml from the api?
You cannot make a crossdomain call to to get XML. Your only choice to receive data crossdomain is
JSON-P.The
same origin policyrestricts direct access to a foreign domain (ajax/iframes),json-pusesdynamic script tag insertionto workaround this issue.Have a look at http://api.jquery.com/jQuery.getJSON/.
JSON-Pis also covered there.edit
http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_json.html
Made for you!