HenrikJoreteg / ICanHaz.js

A clean solution for templating with Mustache.js and jQuery or Zepto
icanhazjs.com
Other
838 stars 132 forks source link

Javascript inside template #64

Open lmarcon opened 10 years ago

lmarcon commented 10 years ago

Hello, l need to keep some javascript code inside a template. Unfortunately this doesn't work, e.g.:

<script type="text/html">
    ... icanhaz template ...

    <script type="text/javascript">
    ... some javascript code (which uses some variables from the template)...
    </script>
</script>

Any help? Thanks a lot

scythargon commented 10 years ago

lmarcon, Hello, did you find solution? Because it also does not allow template variables to not be included in any tag, like this:

blabla {{ some_variable }}

this will render just blabla, when this

<div> 
blabla {{ some_variable }}
</div>

works fine and renders my variable.

lmarcon commented 10 years ago

Thanks for the reply, but honestly it's a problem I had 8+ months ago, and I don't remember exactly how I solved it