Skip to content

Instantly share code, notes, and snippets.

@illucent
Created March 27, 2014 19:50
Show Gist options
  • Select an option

  • Save illucent/9816650 to your computer and use it in GitHub Desktop.

Select an option

Save illucent/9816650 to your computer and use it in GitHub Desktop.
// http://davidwalsh.name/lazy-load-elements
$('article pre').length && (function() {
var mediaPath = '/assets/';
$('<link>').attr({
type: 'text/css',
rel: 'stylesheet',
href: mediaPath + 'css/syntax.css'
}).appendTo(document.head);
var syntaxScript = document.createElement('script');
syntaxScript.async = 'true';
syntaxScript.src = mediaPath + 'js/syntax.js';
doc.body.appendChild(syntaxScript);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment