Skip to content

Instantly share code, notes, and snippets.

@langalex
Created May 2, 2010 10:07
Show Gist options
  • Save langalex/387041 to your computer and use it in GitHub Desktop.
Save langalex/387041 to your computer and use it in GitHub Desktop.
var styles = heredoc(function() {
/*
<style>
.my_css {
...
}
</style>
*/
});
$("head").append(styles);
function heredoc(fun) {
return (fun + '').replace('function () {', '').replace(/\}$/, '').replace('/*', '').replace('*/', '');
};
@langalex
Copy link
Author

langalex commented May 5, 2010

well my problem is that i have html templates in a javascript file so i can't use the dom trick. the e4x syntax would be perfect but only if it was available in all browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment