'); tr.append("
" + val.TeamName + " | "); tr.append("" + val.GamesPlayed + " | "); tr.append("" + val.Wins + " | "); tr.append("" + val.Losses + " | "); tr.append("" + val.Ties + " | "); tr.append("" + val.Points + " | "); $('#tblStats tbody').append(tr); }); }); $('#tblStats').show(); var jsShowPlayers = true; if (tid > 0 && jsShowPlayers) { $('#tblPlayerStats tbody').empty(); $.getJSON('https://api.rampinteractive.com/players/getMSAPlayerStats/2132/10263/10125/' + gtid + '/238679', function (data) { if ( data.length > 0 ){ $('#tblPlayerStats').show(); } else { $('#tblPlayerStats').hide(); } $.each(data, function (key, val) { var lname = val.lname; var fname = val.fname; var isStaff = val.isStaff; var ap = val.AP; var oa = val.OA; var displayName = ""; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); if (!isStaff && ap) { displayName += (displayName != "" ? " (AP/GUEST)" : ""); } if (!isStaff && oa) { displayName += " (OA)" } var jersey = ""; if (val.jersey != null) { jersey = val.jersey; } tr = $('
'); tr.append("" + jersey + " | "); tr.append("" + displayName + " | "); tr.append("" + val.GP + " | "); $('#tblPlayerStats tbody').append(tr); }); }); } else { $('#tblPlayerStats').hide(); $('#tblGoalieStats').hide(); } } else { $('#tblStats').hide(); } };