title: load image src into <img> using jQuery.ajax
body: <p>On my site I would like to offer users the possibility to provide an image URL and then have that image load into a prepared <code>&lt;img src=""&gt;</code> via AJAX. </p>
  
  <p>This is the form including textbox and submit button:</p>
  
  <pre><code>&lt;form id="myform"&gt;
    &lt;input name="image_url" type="text" placeholder="type your image URL" /&gt;
    &lt;input type="submit" name="submit" id="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and this would be the <code>&lt;img&gt;</code> tags:</p>
  
  <pre><code>&lt;img src="" id="image_from_url"&gt;
  </code></pre>
  
  <p>I already have this jQuery statement in order to prevent the default submit button submission:</p>
  
  <pre><code>$(function () {
  
      $('#myform').on('submit', function (e) {
  
        e.preventDefault();
  
      // ajax call here?
  
      });
  
    });
  </code></pre>
  
  <p>Can anybody give a hint on how I could include an ajax call here in order to load the image (from the image url the user provides in the form textbox) into the <code>&lt;img src=""&gt;</code>? </p>
  
  <p>Thank you very much!</p>