knockout example template example not working

In the following code why does the jquery template not render? I thought that the template was build in? thank you

<script id="friendsTemplate" type="text/html">


        {{each(index,friend) friends}}

        <li>${ }</li>



<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <script src="Scripts/knockout-2.2.1.js"></script>
    <form id="form1" runat="server">


        <p>first name: <input data-bind="value: firstName" /></p>
        <p>last name: <input data-bind="value: lastName" /></p>

        <p>full name: <span data-bind ="text: fullName"></span></p>

        <div data-bind="template: 'friendsTemplate'"></div>

        <script id="friendsTemplate" type="text/html">


                {{each(index,friend) friends}}

                <li>${ }</li>




<script type ="text/javascript">

    function friend(name) {
        return {
            name: ko.observable(name)

    var viewModel ={
        firstName: ko.observable("bert"),
        lastName: ko.observable("smith"),
        friends:ko.observableArray([new friend('steve'),new friend('annie')])

    viewModel.fullName = ko.dependentObservable(function () {
        return this.firstName() + " " + this.lastName();



The jQuery.tmpl support is built in however you need to reference jQuery and the jQuery.tmpl to make it work as stated in the documentation under: Note 6: Using jQuery.tmpl, an external string-based template engine:

By default, Knockout comes with support for jquery.tmpl. To use it, you need to reference the following libraries, in this order:

<!-- First jQuery -->     <script src=""></script>
<!-- Then jQuery.tmpl --> <script src="jquery.tmpl.js"></script>
<!-- Then Knockout -->    <script src="knockout-x.y.z.js"></script>

If you reference all the dependencies your code should work fine: Demo JSFiddle

Need Your Help

How to store JSON data from two sources in javascript objects when the data is pulled in at different rates?

javascript jquery reddit embedly

I am trying to create Article objects from links pulled in with ajax (using the jquery reddit api) combined with extra information about the links (pulled in from the jquery api).

Readonly connections with ADO.NET, SQLite and TSQL

tsql sqlite readonly

My code reads via one connection and writes via another. I dont want to accidentally write with the read connection. How can i make the connection readonly? I am using SQLite ATM and will convert