title: Set image content from ajax response
body: <p>I am making a ajax request in jquery as below. This ajax request gets images dynamically. And the image is always different image depending on the value of <code>num</code></p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "ABC.php?num=1",
      success: function(response) {
            if(response == 1) {
                  //some code
            }
            else {
                  // Here I am not able to set image content.
                  $("#image").attr("src", "data:image/png;base64,' + response + '");
            }
      }
  });
  </code></pre>
  
  <p>Is there a way to set image content using the response of the ajax request. Thanks.</p>