For a small image, what (if any) advantage is when downloading using a base64 encoded image in a javascript file (or as a plain HTML file)?
$(document).ready(function(){ var imgsrc = "../images/icon.png"; var img64 = "P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB"; $('img.icon').attr('src', imgsrc); // Type 1 $('img.icon').attr('src', 'data:image/png;base64,' + img64); // Type 2 base64 });
, HTTP-, "" , . , , , , - ( , , ).
, HTTP- CSS . , , , (base64 1,33 ).
, : .
, , HTML, :
<img src="bar.jpg" />
, . TCP/IP , , HTML . .
, jpg, P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB
P/iaVYUy94mcZxqpf9cfCwtPdXVmBfD49NHxwMraWV/iJErLmNwAGT3//w3NB
, - , - , .
, base64. , .
base64, , ( ) CSS Spirtes ( , , ).
base64, .
, , HTTP , - . , . , . - , , , ( , , ).
.
src-, , .