Created
May 22, 2013 02:24
-
-
Save DinoChiesa/5624844 to your computer and use it in GitHub Desktop.
Embed a Gist using jQuery.
This file contains hidden or 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
<link href="http://yandex.st/highlightjs/7.0/styles/default.min.css" rel="stylesheet"> | |
<script src="http://yandex.st/highlightjs/7.0/highlight.min.js"></script> | |
<script type='text/javascript'> $(document).ready(function() { | |
function fixup(s) { | |
var re1 = new RegExp('<','g'), re2 = new RegExp('>','g'); | |
return s.replace(re1,'<').replace(re2,'>'); | |
} | |
$.ajax({type: "GET", | |
url: "https://api.github.com/gists/5617520", | |
dataType: "jsonp", | |
success: function(resp) { | |
var contents = resp.data.files['sql-1.asp'].content; | |
$('#c5617520').html(fixup(contents)); | |
$('#c5617520').each(function(i, e) { | |
hljs.highlightBlock(e); | |
}); | |
}}); | |
}); | |
</script> | |
<div id='d5617520' style='max-height:420px;border:1px dotted black;overflow:auto;padding:0;'> | |
<pre style='margin:0;padding:0;'> | |
<code id='c5617520' style='font-size:10px;margin:0;padding:2px;'> | |
</code> | |
</pre> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment