title: jquery image load strange behaviour
body: <p>I have a page which has a img holder with the html: -</p>
  
  <pre><code>&lt;img src="someimage.jpeg" alt="image" class="show_image"/&gt;
  </code></pre>
  
  <p>Now i m updating the image with jquery using the code...</p>
  
  <pre><code>$('.show_image').attr('src', 'anotherimage.jpeg');
  </code></pre>
  
  <p>now when the image gets loaded i want to run some code...</p>
  
  <p>as image scaling and letting the user know image is loaded</p>
  
  <p>i run this code to know the image is loaded...</p>
  
  <pre><code> var inc = 0;
      $('.show_image').load(function() {
          inc++;
          console.log('image loaded '+inc);
      });
  </code></pre>
  
  <p>now on repeatedly updating the img src the above load function is showing a strange </p>
  
  <p>behaviour and is being called the number of times the img src is updated...</p>
  
  <p>take a look at the firebig logs at this page...(use the prev n next buttons above)</p>
  
  <p>pradyut.dyndns.org/original_image.jsp#imgid=202</p>
  
  <p>i think i have to run the code like this</p>
  
  <pre><code>if(inc==1) {
    //run code
  }
  </code></pre>
  
  <p>Any help</p>
  
  <p>Thanks</p>