In-Page Season Stats
Wednesday, March 25th, 2009Per a User request today, I’ve added in season stats to the Team Stats pages. Previously, clicking on a player’s name would open a new window and take you to that player’s MLB.com detail page. Now when you click on a link, one of two things could happen.
- The preferred scenario: if you have JavaScript enabled, a bubble layer will appear that pulls in the player’s photo, name, link to their MLB.com detail page, and their total stats for the season.
- The alternate scenario: if you don’t have JavaScript enabled, you’ll be taken directly to the player’s MLB.com detail page.
As is always the case, I’m restricted by the stats that are coming from MLB.com. I added in crude calculations for OBP and SLG for batters, but those will only be approximations and may vary by a very slight margin from the official stats. All the other stats should be official and accurate.
The goal of this new functionality is to provide a little more perspective on each player’s overall performance without needing to head off to another site. It was also requested to include the player’s last 7 days of stats. As I discussed a few weeks ago, though, Kilg.us is intended to be a live stat-tracker. It isn’t an aggregating, collecting, statistical database. Nor is it a one-stop shop for managing your fantasy teams. For the same reasons I decided against allowing Users to view stats for any specific date (see the entries about box score emails), it isn’t possible to total stats over 7 day periods.
I was able to pull in the to-date season stats simply because they are easily available. They aren’t being stored in Kilg.us anywhere. Every time a layer is generated, a new AJAX request is made to the XML data sources to pull in the stats (and the player photo). Hopefully this will be a helpful compromise solution.