Sammy.RenderContext load ( location, options, callback )
Load a template into the context.
The location can either be a string specifiying the remote path to the
file, a jQuery object, or a DOM element.
No interpolation happens by default, the content is stored in
content.
In the case of a path, unless the option {cache: false} is passed the
data is stored in the app's templateCache().
If a jQuery or DOM object is passed the innerHTML of the node is pulled in.
This is useful for nesting templates as part of the initial page load wrapped
in invisible elements or <script> tags. With template paths, the template
engine is looked up by the extension. For DOM/jQuery embedded templates,
this isnt possible, so there are a couple of options:
- pass an
{engine:}option. - define the engine in the
data-engineattribute of the passed node. - just store the raw template data and use
interpolate()manually
If a callback is passed it is executed after the template load.