title: Setting <img> src to Base64-encoded image with Javascript is failing
body: <p>I'm trying to set <code>&lt;img&gt;</code> <code>src</code> with JavaScript, but the image is missing visually; it is empty. The image URL after running this code starts with <code>"http://127.0.0.1:8080/%27"</code> (I don't even know where this came from) instead of <code>"data: image/png"</code>. The variable <code>mySrc</code> is set to a Base64-encoded image.</p>
  
  <pre class="lang-js prettyprint-override"><code>document.getElementById(id).src="'"+mySrc+"'";
  </code></pre>
  
  <p>This is what the URL looks like after setting it:</p>
  
  <pre><code>http://127.0.0.1:8080/%27data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4RMNRXhpZgAASUkqAAgAAAAQAAABAwABAAAAuAsAAAEBAwABAAAA9gkAAAIBAwADAAAAzgAAAAMBAwABAAAAAQAAAAYBAwABAAAAAgAAAA4BAgAfAAAA1AAAABIBAwABAAAAAAAAABUBAwABAAAAAwAAABoBBQABAAAA9AAAABsBBQABAAAA/AAAABwBAwABAAAAAQAAACgBAwABAAAAAgAAADEBAgALAAAABAEAADIBAgAUAAAAEAEAADsBAgAEAAAAUm9uAGmHBAABAAAAJAEAAHwBAAAIAAgACABJbWFnZSBjb252ZXJ0ZWQgdXNpbmcgaWZmdG9hbnkAAMDGLQAQJwAAwMYtABAnAABQaWNhc2EgMy4wAAAyMDA4OjA2OjA2IDEwOjM2OjEyAAQAAaADAAEAAAD...
  </code></pre>