'); tr.append("
" + val.TeamName + " | "); tr.append("" + val.GamesPlayed + " | "); tr.append("" + val.Wins + " | "); tr.append("" + val.Losses + " | "); tr.append("" + val.Ties + " | "); tr.append("" + val.Points + " | "); tr.append("" + val.GF + " | "); tr.append("" + val.GA + " | "); var diff = val.GF - val.GA; tr.append("" + diff + " | "); tr.append("" + val.PIM + " | "); $('#tblStats tbody').append(tr); }); }); $('#tblStats').show(); var jsShowPlayers = true; if (tid > 0 && jsShowPlayers) { $('#tblPlayerStats tbody').empty(); $.getJSON('https://api.rampinteractive.com/players/getMSAPlayerStats/2849/9553/20471/' + gtid + '/241380', 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 + " | "); tr.append("" + val.G + " | "); tr.append("" + val.A + " | "); tr.append("" + val.PTS + " | "); tr.append("" + val.PPG + " | "); tr.append("" + val.SHG + " | "); tr.append("" + val.GWG + " | "); tr.append("" + val.PIM + " | "); $('#tblPlayerStats tbody').append(tr); }); }); } else { $('#tblPlayerStats').hide(); $('#tblGoalieStats').hide(); } } else { $('#tblStats').hide(); } };