good day everyone,
hi can anybody here wanna help me?
i want to replace missing images automatically on load of the page,.
i got some code on the net but it doesn't work on IE,. here's the code,.
here's another one that is not workingon IE,.Code:for (var i=0; i<document.images.length; i++){ img = new Image(); img.src = document.images[i].src; if (img.height == 0) document.images[i].src = '<?php echo $livesitePath; ?>images/picnotavailable.jpg'; }
Code:$(window).load(function() { $('img').each(function() { if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0 || this.src=="") { // image was broken, replace with your new image this.src = '<?php echo $livesitePath; ?>images/picnotavailable.jpg'; } }); });



Reply With Quote


Bookmarks