Hacker News new | ask | show | jobs
by chrisbroadfoot 3448 days ago
Shouldn't you use a different "type"? What you're putting in there is not JavaScript, it's something else.

Use <script type="text/ejs">?

1 comments

But it does become javascript so it needs the right script type. A way to work around this might be to do this:

<script type="<%= js_mime %>"> <div><%= something %>

then it won't be escaped presumably as js, but it will become js when it is run through the other templating system. sentiental have you tried that approach?