title: Insert Javascript code inside img src
body: <p>I've tried to insert Javascript code to a src tag from an img, the code looks like:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img id="p1" width="90%" height="100%" src="javascript:img_info();" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So basically it gets an image out of an API since the function <code>img_info();</code> generates a link. The problem is that when i run this code it doesn't return anything, any ideas?</p>