HughDai / embeddedjavascript

EJS cleans the HTML out of your JavaScript with client side templates
http://code.google.com/p/embeddedjavascript
Other
0 stars 0 forks source link

Please make the EJS construtor accept element's of type "script" #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be really nice if the constructor could not only check for "value" or 
"innerHTML" but also "text" to get the value form <script>-elements.
Then it would be possible to embed ejs script on a page without "abusing" the 
usage of textarea just to be able to type '< characters. I.e. it would be 
possible to do:
<script type="text/ejs">
<li>
    <a href='supplies/<%= supplies[i] %>'>
        <%= supplies[i] %>
    </a>
</li>
</script>

I have tested this approach on pretty much all browsers and it works like a 
charm, other libraries use it as well, such as dojo for their templating.

Original issue reported on code.google.com by erik.win...@gmail.com on 21 Jan 2011 at 1:47

GoogleCodeExporter commented 9 years ago
...i just locally patched this code and when I did it seemed like the code 
ignored the "type" option when an "element" option was provided, so that could 
be worth paying attention if you'll decide to implement this feature.

Best regards, Erik 

 Alfresco Software 
www.alfresco.org

Original comment by erik.win...@gmail.com on 24 Jan 2011 at 8:46