jQuery.fn.text
Extending the original jQuery().text() to render [can.View] templates as the content of each matched element. Unlike jQuery.fn.html jQuery.fn.text also works with XML, escaping the provided string as necessary.
modifiers.text(content, data, callback)
Extending the original jQuery().text() to render [can.View] templates as the content of each matched element. Unlike jQuery.fn.html jQuery.fn.text also works with XML, escaping the provided string as necessary.
Parameters
-
content
{String | Object | function()}
A template filename or the id of a view script tag or a DOM element, array of elements, HTML string, or can object.
-
data
{Object}
OptionalThe data to render the view with. If rendering a view template this parameter always has to be present (use the empty object initializer {} for no data).
-
callback
{function()}
OptionalA success callback to load the view asynchronously
Returns
{jQuery | can.Deferred}
The jQuery object or a can.Deferred if a deferred has been passed in data.
$('#test').text('path/to/template.ejs', { name : 'canjs' });