jQuery.fn.append

  • function
 

Extending the original jQuery().append() to render can.view templates inserted at the end of each element in the set of matched elements.

modifiers.append(content, data, callback)

Extending the original jQuery().append() to render can.view templates inserted at the end of each element in the set of matched elements.

Parameters

  1. 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.

  2. data {Object}Optional

    The 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).

  3. callback {function()}Optional

    A 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').append('path/to/template.ejs', { name : 'canjs' });