Template.js for Browser, Rhino and Helma

Juerg Lehni <[email protected]>
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
I just uploaded new versions of Template.js, which include some bug  
fixes, but most of all now offer the possibility to be used in the  
browser too. There is also a version that can be used in a general  
Rhino based environment, without the Helma additions.

A simple example in the browser would then look like this:

---

// Copy over the renderTemplate method from Template.methods...
var renderTemplate = Template.methods.renderTemplate;

var template = new Template("<%foreach $value in param.values %>Hello  
<%= $value %>, <% param.message %><br /><% end %>");

alert(renderTemplate(template, {
	values: ["Browser", "Rhino", "Helma"],
	message: "Isn't this great?"
}));

---

I hope this is usefull for some of you.

Jürg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.