Skip to content

Instantly share code, notes, and snippets.

@max-mapper
Created March 29, 2014 18:17
Show Gist options
  • Save max-mapper/9859401 to your computer and use it in GitHub Desktop.
Save max-mapper/9859401 to your computer and use it in GitHub Desktop.
load a <script> tag from a gist raw url
<!doctype html>
<html>
<head>
<style type="text/css">
html, body { margin: 0; padding: 0; }
</style>
</head>
<body>
<script type='text/javascript'>
function loadRaw(gistID) {
var bundleURL = "https://gist.githubusercontent.com/" + gistID + "/raw/minified.js"
var script = document.createElement('script')
script.setAttribute('src', bundleURL)
document.head.appendChild(script)
}
loadRaw('maxogden/9576573')
</script>
</body>
</html>
@Tylerdclark
Copy link

This might not work now. As a work around, you could use a free service in lieu of a CDN -> rawgithack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment