Template Posts

1 post tagged with template

Here's a quick ‘n’ dirty Javascript function I hacked together that provides Django-like template substitution.

Used something like this:

Which returns the following string:

Alas, it doesn't support anything other than substitution. If you need anything more advanced (loops etc), you should investigate Javascript template engines.