Created
January 10, 2014 21:32
-
-
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>
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
$(".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