Using Jquery to display your GitHub repos

Here is a quick little script to pull down your GitHub Repos and display them on a page:

Interesting note - I started off by using the append function inside the $.each loop - but after reading Josh Powell’s post on using append correctly I switched to building the HTML from a concatenated string. The result loads noticeably faster.

Check out the result on GitHub:

http://johnboxall.github.com/

2 Responses to “Using Jquery to display your GitHub repos”

  1. Josh Powell Says:

    Thanks John, you made my day :) One thing I learned after writing the article, and added in the first comment, was that it is much quicker to append a single node with a lot of children then it is to append a bunch of nodes. So in your example above, if you could find a way to append the complete list instead of the list items it would be measurably quicker. Possibly use replaceWith() or replaceAll() instead of append.

  2. John Says:

    Thanks for the excellent article Josh! Check out Josh’s full reasoning here:
    http://www.learningjquery.com/2009/03/43439-reasons-to-use-append-correctly/comment-page-1#comment-71018

    Without knowledge of JQuery’s internal working it’s very easy to write inefficient code.

    John Resig also had excellent post about profiling JS functions using FireUnit:
    http://ejohn.org/blog/function-call-profiling/

Leave a Reply