Permalink
Browse files

Re-rendering template in a single call

  • Loading branch information...
1 parent d5f609f commit 45348ff1725f4afeeab50f91d961fe1863c5df7b @hoverbird hoverbird committed Apr 6, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 js/glue.js
View
@@ -39,15 +39,14 @@ $(function() {
}
function renderTemplate(templateName, templateContainer) {
+
$.ajax({
url: templateName + ".html",
cache: false
}).done(function(html) {
- templateContainer
- .empty()
- .append(html)
+ templateContainer.html(html)
var subincludes = templateContainer.find($('[glue-src]'));
- if(subincludes.length != 0) {
+ if (subincludes.length != 0) {
subincludes.each(function() {
renderTemplate($(this).attr('glue-src'), $(this));
})

0 comments on commit 45348ff

Please sign in to comment.