如何使用base64设置图像源
2022-08-30 05:24:20
我想将图像源设置为base64源,但它不起作用:
<img id="img" src="" />
JavaScript
document.getElementById("img").src = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg=="