I am having trouble retrieving the AJAX response from Vimeo to extract a thumbnail without using JQuery. Even though I can see the response data in JSON format when I type the response query (http://vimeo.com/api/v2/video/30408418.json) into the browser and download the file, my code is not receiving the response.
After trying the same request on a page where Flickr responses were working with jQuery and still getting an empty response, I believe it is not a JSONP issue.
var vimeoVid= {};
var request = getHTTPObject();
if(request){
var requString="http://vimeo.com/api/v2/video/30408418.json";
request.open('GET',requString,true);
request.onreadystatechange=function(){
if(request.readyState==4){
vimeoVid = JSON.parse(request.responseText);
}
};
request.send();
}
else
{
alert('Sorry, your browser doesn\'t support XMLHttpRequest');
}
console.log("vimeoVid");
Here is the function used:
function getHTTPObject(){
if(typeof XMLHttpRequest == "undefined")
XMLHttpRequest=function(){
try{return new ActiveXObject("Msxml2.HHHTP.6.0");}
catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0");}
catch(e){}
try{return new ActiveXObject
("Msxml2.XMLHTTP");}
catch(e){}
return false;
}
return new XMLHttpRequest();
}