0

Score Results Widget-ified

Posted by Chris on Monday, September 21, 2009 in , , ,
That's right - the fantastic Score Results website (a partner site for the soon-to-be released ScoreSure website) now includes code so that you can display your own league tables on a blog/website as a widget. Just a couple of lines of code (copied and pasted) and you're away!

The trickiest part is the use of an iframe (and its auto-resizing code) to display the league table. Why iframes and not ajax (the most common method suggested when resizing iframes becomes an issue?) Well, every entry in the league table can be clicked on, to display team members, member profiles and so on. Although possible, writing ajax functions and callbacks to handle every clickable link would be a nightmare - iframes are just easier to implement!

The headache comes when you want to include the league table (hosted at www.scoreresults.co.uk) in an iframe hosted on another domain. Obviously scripting across domains isn't possible, so there's a bit of trickery involved, to make sure that the iframe is resized after content has been loaded into it.

Here's an example of the widget in use. The league table below was included in this blog by simply pasting the following two lines of code:

<script type="text/javascript" src="http://www.scoreresults.co.uk/js/leaguetable_widget.js"></script>
<script type="text/javascript">drawFrame("2DD610F1CA7342A0BEF9E50540F2FFB5");</script>



0 Comments

Post a Comment

whos.amung.us

Copyright © 2009 .Nerd Club All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive Supported by Blogger Templates.