Window. The URL=window. URL | | window. WebkitURL;
var xhr=new XMLHttpRequest();
XHR. Open (" get ", imgUrl, true);
//vital
XHR. ResponseType="blob";
XHR. onl oad=function () {
If (this. Status==200) {
//get a blob object
var blob=this.response;
//the console. The log (" blob "blob);
//vital
Let oFileReader=new FileReader ();
OFileReader. onl oadend=function (e) {
//to get here is the picture of base64
Let base64=e. arget. Result;
Base64="& lt; P id="' Base64Text '& gt;" + base64 + "& lt;/p> ";
Document. The getElementsByTagName (" body ") [0]. InnerHTML=base64;
Return base64.
};
OFileReader. ReadAsDataURL (blob);
}
}
xhr.send();
}
I find such a JS code on the Internet, you can get the network file base64, can at first, but then don't know what is the limit, web developers do to can not get, is there any way to break through?
CodePudding user response:
Should set up a cross-domain request that the feeling is prohibitedCodePudding user response: