<script id="myScript" type="text/x-template"> alert('Hello!'); </script> <script type="text/javascript"> eval( document.getElementById('myScript').innerHTML ); </script>