Hey, did you know that there was a Javascript extension to the Template-Toolkit?
That's exactly what Jemplate does, and it does it quite elegantly I must admit.
This CPAN module is definately worth looking into, just for fun at least. For more information you might want to check out the article Jemplate - A Template Toolkit for Javascript.
Closer inspection of the code reveals that this is nothing more than a quick switch Template::Directive sleight of hand, that's all really.
You might also want to consider using OpenThought - Web Application Environment which doesn't require page reloads.
Not so sure if I will ever use it, but it is interesting to know about anyway.