title: Image onload fires multiple times
body: <p>I have a function being triggered when an image is loaded through the onload attribute in the image tag. This image is being appended to the DOM through some jQuery. The problem that I'm having is that when jQuery throws that image in, the function associated with onload fires 6 times. This isn't a compounding problem (eg. the first time, it fires once, the second time it fires twice), like some of the solutions I see. This fires 6 times consistently. Would anybody know why it is doing this?</p>
  
  <p>Image triggering the function:</p>
  
  <pre><code>&lt;img src='image_source.png' onload='myFunction();' /&gt;
  </code></pre>
  
  <p>Function:</p>
  
  <pre><code>function myFunction(){
    console.log('hello');
  }
  </code></pre>
  
  <p>Hello shows up 6 times in the console log. Thank you for any insight you may be able to offer.</p>
  
  <p>EDIT - here's the code that adds the image</p>
  
  <pre><code>$("[id=" + type + "]").html("&lt;img src='" + image + "' class='loaded_image' onload='myFunction();' /&gt;");
  </code></pre>