0

For MiniProfiler we use the beta version of jquery.tmpl turns out it is incompatible with jsRender, something that is causing pain for some of our users.

Is there a way to load up jquery.tmpl in an unobtrusive way so it plays nice with other templating engines that may already be loaded in the page?

Are there any of the other templating engines (eg. mustache or whatever) that allow themselves to be loaded in a totally unobtrusive way, meaning that multiple versions can run side by side an play nice?

Community
  • 1
  • 1
Sam Saffron
  • 128,308
  • 78
  • 326
  • 506

2 Answers2

3

Sure, jQuery.tmpl can run quite easily in an unobtrusive mode, all that is required is passing it a different jQuery object ... for example:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var jQueryMP = $.noConflict();
</script>

then edit the last line on jQuery.tmpl from:

})(jQuery);

to:

})(jQueryMP);
vstm
  • 12,407
  • 1
  • 51
  • 47
Sam Saffron
  • 128,308
  • 78
  • 326
  • 506
0

You might try the Distal templating engine, which I've been using.

mellamokb
  • 56,094
  • 12
  • 110
  • 136
Kernel James
  • 3,752
  • 25
  • 32