I'm using the Youtube API (https://developers.google.com/youtube/v3/?hl=en ), in particular: playlists, playlistItems and channels to load.
This works great in all browsers,e xpect IE9 and lower. Here I always get a "No Transport"
error.
This is a simple sample code:
<!Doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Youtube API Test</title>
</head>
<body>
<code>
</code>
<script src="Scripts/jquery-2.1.4.js"></script>
<script>
$.ajax({
cache: false,
type: 'GET',
crossDomain: true,
url: 'https://www.googleapis.com/youtube/v3/playlistItems',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (data) {
$('code').text(JSON.stringify(data, null, 4));
},
error: function (err) {
$('code').text(JSON.stringify(err, null, 4));
}
});
</script>
</body>
</html>
(Note I remove the parameters, in Chrome and FF this returns a youtube error, in IE a "No Transport" error).
I tried using the xdomain
plugin (https://github.com/jpillora/xdomain)
and the XDomainRequest
plugin (https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest#instructions)
as suggest here, with no success. Anything I am missing, does this work for anybody else?