title: jquery checking if an image exists in a folder
body: <p>i am changing the source of an image using the following code:</p>
  
  <pre><code>var src = "/Content/Productimg/" + data.image +".jpg";
                $("#image").attr("src", src);
  </code></pre>
  
  <p>However, sometimes if data.img returns test and test.jpg does not exist in the Productimg folder a funny icon is displayed.</p>
  
  <p>Is there a way i can check if the image is there before assigning the src?</p>