71104 / jquery-handlebars

A jQuery plugin to render Handlebars.js templates into elements
http://71104.github.io/jquery-handlebars
MIT License
101 stars 39 forks source link

Added sync option to always render templates synchronously #10

Closed himdel closed 6 years ago

himdel commented 10 years ago

Added sync option - when true, $.fn.render calls that can't find the template without ajax throw an exception

Templates are no longer cached by URL, only by template name. (Because locally added templates have no url and inventing a fake one would complicate searching if both ways are used.)

The rationale is to be reasonably compatible with jquery.mustache.js, because while converting $.fn.mustache( tpl, data, { method: html }) to $.fn.render( tpl, data ) is easy, lots of code written for mustache expects the template to be rendered synchronously, and without sync: true, $('#foo').render('tpl', {}); $('#foo .something').whatever(); doesn't really work (except when it does).

himdel commented 6 years ago

No activity in years, closing