Skip to content

Instantly share code, notes, and snippets.

@mcfog
Created December 31, 2011 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcfog/1542897 to your computer and use it in GitHub Desktop.
Save mcfog/1542897 to your computer and use it in GitHub Desktop.
coco - contentEval
contentEval = (source, doc=document)->
source = '(' + source + ')();' if \function == typeof source
script = doc.createElement \script
script.setAttribute \type, "application/javascript"
script.textContent = source
doc.body.appendChild script
doc.body.removeChild script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment