Example: <script type="text/x-jquery-tmpl" id="timeTagTemplate"> ${$data} </script> <script type="text/x-jquery-tmpl" id="commentTemplate">
Created
April 8, 2011 11:00
-
-
Save duncanbeevers/909639 to your computer and use it in GitHub Desktop.
Create a jQuery Template tag method out of a template
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
(function($) { | |
$.fn.extend({ | |
tmplHelper: function(method, selector) { | |
$.tmpl.tag[method] = { | |
open: "if($notnull_1){_=_.concat($item.nest(" + selector + ",$1));}" | |
}; | |
return this; | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment