image url to base64
image url to base64
https://www.browserling.com/tools/image-to-base64
https://www.askapache.com/online-tools/base64-image-converter/
https://codebeautify.org/base64-to-image-converter
https://www.sitepoint.com/community/t/converting-images-to-a-base64-data-url/282947/2
image to base64
SVG & PNG
(function(win,doc) {
"use strict";
var svg = new XMLSerializer().serializeToString(doc.getElementsByTagName("svg")[0]);
// var png = new XMLSerializer().serializeToString(doc.getElementsByTagName("png")[0]);
var base64 = win.btoa(svg);
// var base64 = win.btoa(png);
doc.getElementById("base").appendChild(doc.createTextNode("data:image/svg+xml;base64," + base64));
// doc.getElementById("base").appendChild(doc.createTextNode("data:image/png;base64," + base64));
}(window, document));
preloading & images
https://www.sitepoint.com/preloading-images-in-parallel-with-promises/
https://css-tricks.com/data-uris/
https://www.sitepoint.com/community/t/converting-images-to-a-base64-data-url/282947
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/9706230.html
未经授权禁止转载,违者必究!