Skip to content

Instantly share code, notes, and snippets.

@mscalora
Created October 31, 2014 13:27
Show Gist options
  • Save mscalora/c9833db193d47d546195 to your computer and use it in GitHub Desktop.
Save mscalora/c9833db193d47d546195 to your computer and use it in GitHub Desktop.
Create a link to download the inner HTML of the body without script or noscript elements
$('<a download="body-html.html">Download Body HTML</a>').attr('href','data:text/html,'+encodeURIComponent($('body').clone().find('script, noscript').remove().end().html())).prependTo('body')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment