This example rewrites p302, but embeds the template in a <script> element.
<script>
Try the following
template