title: JQUERY/PHP: base64_encoded image data not displaying on CHROME, IE, OPERA
body: <p>I have images stored in BLOB format in my database. My PHP code can access this BLOB data and return it to client side HTML page in JSON format.</p>
  
  <p>How do I display this data on my HTML page?</p>
  
  <p>I have tried using base64_encode but it works only for Firefox.
  THIS CODE IS NOT WORKING FOR CHROME, IE, OPERA.</p>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>$json2[] = array("Picture"=&gt;base64_encode($row2[33]));
  header("Content-Type: application/json; charset=UTF-8");
  header("Content-type:image/jpeg");
  echo json_encode($json2);
  </code></pre>
  
  <p>And this is my JQuery code:</p>
  
  <pre><code>success: function(data){
  
          var str = JSON.stringify(data);
          var obj = JSON.parse(str);
          $('#pic0').html('&lt;img  height="40" width="40" src="data:image/jpeg;base64,' + obj[0].Picture + '" /&gt;');
  }
  </code></pre>
  
  <p>success function is a part of AJAX call.
  My primary aim is to display this image in Mobile devices since this is a part of WebService Call.
  From what i have read, it seems base64_encode has some limitations in working for every browser.</p>
  
  <p>How can I display the images on HTML page?</p>
  
  <p>I have checked other posts in SO but unable to find anything fruitful.</p>