//接口地址
var url=oauth_server+'captcha.jpg';
//创建请求
var xhr=new XMLHttpRequest();
//请求方式
xhr.open('get',url,true);
xhr.responseType='blob';
xhr.οnlοad=function()
{
if(this.status==200)
{
//二进制转图片地址
var blob=this.response;
var img=document.createElement("img");
img.οnlοad=function(e)
{
window.URL.revokeObjectURL(img.src);
};
img.src=window.URL.createObjectURL(blob);
//展示图片
$("#yzm").attr("src",img.src);
}
}
xhr.send();