Skip to content

Instantly share code, notes, and snippets.

@mikelikesbikes
Forked from jasonkarns/index.html
Created February 22, 2010 21:43
Show Gist options
  • Save mikelikesbikes/311550 to your computer and use it in GitHub Desktop.
Save mikelikesbikes/311550 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
jQuery(function($){
//tested
$('script.html_script').each(function() {
$(this).replaceWith($(this).text());
});
});
</script>
</head>
<body>
<h1>Some header</h1>
<p>Some content</p>
<script type="text/html" class="html_script">
<p>I'm a set of UI controls that require JS but now I'm contextually relevant and I'm not littering anyone's JS files with HTML!</p>
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment