function splitBytes(data)
{
var data_string='';
for(var i=0,il=data.length;i<il;i++){
var cCode=data.charCodeAt(i);
var bytes=[],highestByte=0;
for(var j=0;j<4;j++){
bytes[j]=cCode>>>(8*j);
if(bytes[j])highestByte=j;
}
console.log(bytes,highestByte);
if(highestByte==0){data_string+=String.fromCharCode(bytes[0]);continue;}
data_string+=String.fromCharCode(bytes[highestByte]|(12*16));
for(var j=highestByte-1;j>=0;j--){
data_string+=String.fromCharCode(bytes[j]|(8*16));
}
}
return data_string;
};
var xhr=new XMLHttpRequest();
xhr.open("GET","http://www.google.com/recaptcha/api/image?c=03AHJ_VuuTZPpE0MzmQ0H3MXLoflLPf6Ofe-gOvgoorBrOKN9f6iHglvIkBp8Hm6gPT6au_9pPLqAfoKFKcxNF-14dUbxfKmN34nuVpLvddLiSEY52pYuRcIuSj3vCwJ4P2rDPQI49Ej9O65sPTXh0CskwWbohadL9GA",false);
//xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.send();
var imgbase64=btoa(splitBytes(xhr.responseText));
window.location.href="data:image/jpeg;base64,"+imgbase64;
console.log(img);
тоже хреново пашет