长这个样子
<div class="headL"></div>
用到window.URL.revokeObjectURL
和window.URL.createObjectURL
;
<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>