Created
February 4, 2013 18:27
-
-
Save mclaughj/4708534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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