Downvoters: этот код предоставляется только для информации.
Это было протестировано в Fx 19 и Chrome 24 на Mac
var new_comment; /*<<
You
$text
2d
EOF*/
// note the script tag here is hardcoded as the FIRST tag
new_comment=document.currentScript.innerHTML.split("EOF")[1];
alert(new_comment.replace('$text','Here goes some text'));