title: How to get Image through ajax jquery?
body: <p>I want to display image by ajax jquery in this way so is that possible? </p>
  
  <pre><code>$.ajax({  
      url: "c.jpeg",
      type :"get",
      dataType: "image/jpeg",
  
      success: function(data)
      {
  
        $("#myimg2").attr("src",data);
      }
  
     })
  </code></pre>
  
  <p>and this is the html</p>
  
  <pre><code>&lt;body&gt;
  &lt;img id="myimg2" &gt;&lt;br&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>If that could be possible in some way. I want also to get the image from php file rather than directly jpeg file using this header.</p>
  
  <pre><code>header('content-type: image/jpeg');
  </code></pre>