Prev Home Next

4 Data Arrays

Data:

var people = [
	{
		firstName: "Jeff"
	},
	{
		firstName: "Rebecca"
	}
];

Script:

// An array renders once for each item (concatenated)
var html = $( "#personTmpl" ).render( people );

// Insert as HTML
$( "#details" ).html( html );