jquery ajax vs browser url
- by danwoods
Hello all,
I'm trying to use youtube's api to bring back a listing of a user's videos. The request url looks something like:
http://gdata.youtube.com/feeds/api/users/username/uploads
with 'username' being the correct username. This bring back the appropriate url in the browser. However when I try to access that url via jQuery's $.ajax or $.get functions, using something like:
$.ajax({
//set parameters
url: "http://gdata.youtube.com/feeds/api/users/username/uploads",
type: "GET",
//on success
success: function (data) {
alert("xml successfully captured\n\n" + data);
},
//on error
error:function (XMLHttpRequest, textStatus, errorThrown, data){
alert(" We're sorry, there seem to be a problem with our connection to youtube.\nYou can access all our videos here: http://www.youtube.com/user/username");
alert(data);
}
});
$.get("http://gdata.youtube.com/feeds/api/users/username/uploads", function(data){
alert("Data Loaded: " + data);
});
I get an empty document returned. Any ideas why this is?