Created
May 2, 2010 10:07
-
-
Save langalex/387041 to your computer and use it in GitHub Desktop.
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
var styles = heredoc(function() { | |
/* | |
<style> | |
.my_css { | |
... | |
} | |
</style> | |
*/ | |
}); | |
$("head").append(styles); | |
function heredoc(fun) { | |
return (fun + '').replace('function () {', '').replace(/\}$/, '').replace('/*', '').replace('*/', ''); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.