前端接收,text/html类型 的图片流

2019-04-11  本文已影响0人  奋斗滴猩猩
image.png

<div class="headL"></div>
<script>
var xhr=new XMLHttpRequest();
xhr.open("GET","图片URL",true);
xhr.responseType = "blob";
xhr.onload = function () {
var blob = this.response;
var img = document.createElement("img");
img.onload = function (e) {
window.URL.revokeObjectURL(img.src);
};
img.src = window.URL.createObjectURL(blob);
$(".headL").html(img);
}
xhr.send();
</script>

上一篇下一篇

猜你喜欢

热点阅读