jquery image not loading problem -
Do anyone know how to load an image properly I have a script that preload images And what I wanted to do, if the image does not exist, which does not end my script, then I will only create the attribute "src" for being a "default value"
Image.load (function () {// this image is not present here if it never comes again}). Attr ('src', 'a non-existing image');
thanks
var image = $ (' & Lt; img & gt; ') appendTo (.' Body '); Image.load (function () {// image found and loaded}). Error (function () {// Image not loaded image .attr ('src', 'default-image.jpg');}) Attr ('Src', 'a non-current image');
Comments
Post a Comment