diff --git a/Source/onerror.js b/Source/onerror.js new file mode 100644 index 0000000..5ca8b77 --- /dev/null +++ b/Source/onerror.js @@ -0,0 +1,34 @@ +/*Adding onerror listener to show all images, if an error will occur*/ +window.onerror = function() { + + window.onload = function() { + + /*Getting all images*/ + var images = document.getElementsByTagName('img'); + + if(images.length > 0) { + + var src = null; + + for( var i = 0; i <= images.length; i++ ) { + + if( typeof images[i] != 'undefined' ) { + + src = images[i].getAttribute('data_src'); + + /*If specified real src in image, change it*/ + if( src ) { + + images[i].src = src; + + } + + } + + } + + } + + } + +} \ No newline at end of file