diff --git a/index.html b/index.html index 74dc362c7..bceac282c 100644 --- a/index.html +++ b/index.html @@ -1097,6 +1097,16 @@ var list = "<% _.each(people, function(name) { %> <li><%= name %& _.template(list, {people : ['moe', 'curly', 'larry']}); => "<li>moe</li><li>curly</li><li>larry</li>" +

+ You can also use print from within JavaScript code. This is + sometimes more convenient than using <%= ... %>. +

+ +
+var compiled = _.template("<% print('Hello ' + epithet); %>");
+compiled({epithet: "dude"});
+=> "Hello dude."
+

If ERB-style delimiters aren't your cup of tea, you can change Underscore's template settings to use different symbols to set off interpolated code.