HTML代码:
<div id="forAppend" class="demo"></div>
JS代码:
var eleAppend = document.getElementById("forAppend");
window.URL = window.URL || window.webkitURL;
if (typeof history.pushState == "function") {
var xhr = new XMLHttpRequest();
xhr.open("get", "/image/study/s/s256/mm1.jpg", true);
xhr.responseType = "blob";
xhr.onload = function() {
if (this.status == 200) {
var blob = this.response;
var img = document.createElement("img");
img.onload = function(e) {
window.URL.revokeObjectURL(img.src);
相关文章:
-
2021-10-01
-
2021-10-10
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-07-14
-
2022-12-23
-
2021-09-26