Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
$(document).ready(function(){
$('.gistinclude').each(function(){
var gistLocation = $(this);
var state = 0;
$.getJSON('http://gist.github.com/'+$(this).attr('data-gistid')+'.json?callback=?', function(data){
gistLocation.replaceWith(data.div);
if (state == 0) {
$('head').append('<link rel="stylesheet" href="'+data.stylesheet+'" type="text/css" />');
state = 1;
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment