Created
February 20, 2012 19:16
-
-
Save dazld/1870830 to your computer and use it in GitHub Desktop.
ICH Template Loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadTemplate: function(file,callback){ | |
var that = this; | |
var partial = false; | |
if (file.indexOf('partial') !== -1) { | |
partial = true; | |
}; | |
$.post('templates/'+file+'.tpl',function(e){ | |
var s = document.createElement('script'); | |
s.setAttribute('id',file); | |
s.setAttribute('type','text/html'); | |
if (partial) { | |
s.setAttribute('class','partial'); | |
}; | |
s.innerHTML = e; | |
$("body").append(s); | |
ich.grabTemplates(); | |
if (typeof(callback) === 'function') { | |
callback(); | |
}; | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment