View Single Post
Old 05-13-2019, 03:02 PM   #2
andjbock
Hall Of Famer
 
andjbock's Avatar
 
Join Date: Jul 2003
Location: Somerville, MA, USA Bats: Right Throws: Left
Posts: 3,640
Hi self,

If you add the following code to head_bits.tpl (templates folder in your saved league, not the default templates folder) this should then be produced across all html pages.

Replace "http://ootp.biz/lgreports/images/default_player_photo.png" with the location and name of the image you want to globally replace broken image links with.

Use < script ></script> tags around all of the code below.


Code:
$(window).bind('load', function() {
$('img').each(function() {
    if((typeof this.naturalWidth != "undefined" &&
        this.naturalWidth == 0 ) 
        || this.readyState == 'uninitialized' ) {
        $(this).attr('src', 'http://ootp.biz/lgreports/images/default_player_photo.png');
    }
}); })

Last edited by andjbock; 05-24-2019 at 09:52 AM.
andjbock is offline   Reply With Quote