I have a series of helper functions to do formatting, etc inside jQuery.tmpl templates. The documentation suggests this can be passed in as the options argument in the template function. What I’d like is to have all these helper functions included by default into any jquery template, so I don’t have to explicitly add it every time.
I realize this could be done with a global variable, but I kind of like the $item.xxx()syntax… Is there a way to specify default options for templating, similar to $.ajaxOptions or any of the other defaulting mechanisms, or is this a bad idea to begin with?
The jQuery templating plugin docs are here. I don’t see anything there about global options though.
You could, perhaps: