***Stream or Serialize JPEG Image from Server Here w/o ...">

Does HTML support embedded image encoding by stream?

Example:

<div id="sampleimage">

***Stream or Serialize JPEG Image from Server Here w/o Sending another Request***

</div>

So send all in one answer.

+5
source share
2 answers

In some browsers (in FF, Chrome, and apparently in IE8), you can use the data URL scheme to insert the image file into HTML.

It looks something like this (taken from the RFC):

<IMG
   SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
   AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
   ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
   a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
   ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
   F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
   hhx4dbgYKAAA7"
   ALT="Larry">

You can see that the data for the image is encoded in base64 . I believe you can also use this format to assign images in javascript and use them in CSS.

+11
source

Yes, it is possible: see here

+4
source

All Articles