title: How do you show raw image data on the web with javascript?
body: <p>I have an API endpoint for image files and it always sends down the raw data. How do I show this image data on a website? Ideally I would like to use the img tag or css background-image property and not canvas.</p>
  
  <p>Here is some code that could be used:</p>
  
  <pre><code>$.get({
    url: '/some-image',
    success: function(data) {
      // Load raw image data somewhere and show it on webpage.
    },
  });
  </code></pre>
  
  <p>In my case I am actually using a library called axios but I have used a jquery example as I though it would be more well-known.</p>
  
  <p>Just to be clear the data I receive looks like this:</p>
  
  <pre><code>����JFIF��� ( %!1!%)+...383-7(-.+ 
  -------------+-------------+-+--+-----------+-----+���"����?!1AQa"q����2����R��Br�#b$4D�������%!1A2Q"Ca��?��]0`V�a����:T���E�R����$�jy$�6�GcP��Q��$�Fk,� ;D������\�e�l��(GE��[c,���w�P�&amp;�J1rz.mM��]��!����\ �\̺I�:.�[&amp;o=~z�7Y�'#T �_�%��u+����rg�i��p��^�����c���[E�ʔ����)E���b x�=U!M���3��6�k8��R��0&amp;&lt;?K�Kn���pd+'��Vt��|l�Z���i1�Pic*R79�8 b]A&lt;�ݿ��@mw} kBjѲٸ�Tm��m�+ǖ���G�jv&amp;��D:Ƽ$sD2zf
  </code></pre>