i have this script working nicely , but i need to figure this out
the script searches the database on the site for franchise icons and replaces the corresponding franchise name with the icons , however there are occasions where a franchise has no icon and i need to make the script return the text , currently it leaves a big box with an "X" in it , with no name or icon.
var prop, fdb = null, filter_fn;
filter_fn = function() {return $(this).text() === fdb.name;};
for(prop in window.franchiseDatabase) {
if (/^fid_/.test(prop) && prop !== 'fid_0000') {
fdb = window.franchiseDatabase[prop];
$('#brief_standings, #livescoring_summary, #recent_draft_picks')
.find('td').filter(filter_fn)
.html( '<a href="' + window.baseURLDynamic + '/' + window.year + '/options?L=' + window.league_id + '&F=' + fdb.id + '&O=01">' + '<img src="' + fdb.icon + '"class="franchiseicon" title="' + fdb.name + '" /></a>' );
}
}