📅  最后修改于: 2022-03-11 15:02:19.062000             🧑  作者: Mango
function toBase64(arr) {
//arr = new Uint8Array(arr) if it's an ArrayBuffer
return btoa(
arr.reduce((data, byte) => data + String.fromCharCode(byte), '')
);
}
$('#two').prepend($('',{id:'theImg2',src:`data:image/png;base64,${toBase64( selected[0].image2.data)}`}))