Skip to content

Instantly share code, notes, and snippets.

@markis
Created January 10, 2014 21:32
Show Gist options
  • Save markis/8363048 to your computer and use it in GitHub Desktop.
Save markis/8363048 to your computer and use it in GitHub Desktop.
wrap html that doesn't need to be loaded on initial load in <div class="deferParsing"><!-- --></div>
$(".deferParsing").each(function(idx, elem) {
var $elem = $(elem),
comments = $elem
.contents()
.filter(function(){return this.nodeType === 8;})
.get(0)
;
$elem.replaceWith(comments.nodeValue);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment