Skip to content

Instantly share code, notes, and snippets.

@mclaughj
Created February 4, 2013 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mclaughj/4708534 to your computer and use it in GitHub Desktop.
Save mclaughj/4708534 to your computer and use it in GitHub Desktop.
$(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