Skip to content

Instantly share code, notes, and snippets.

@swalke16
Created October 21, 2011 18:51
Show Gist options
  • Save swalke16/1304628 to your computer and use it in GitHub Desktop.
Save swalke16/1304628 to your computer and use it in GitHub Desktop.
Binding Provider
<html>
<head>
<script type='text/javascript' language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type='text/javascript' language="javascript" src="javascripts/knockout.js"></script>
<script type="text/html" id="contactTemplate">
<tr>
<td class='name'></td>
<td class='phone_number'></td>
</tr>
</script>
</head>
<body>
<form id="contact_form">
<label> Name: <input id="name" name="name" type="text"></input></label>
<label> Phone: <input id="phone_number" name="phone_number" type="text"></input></label>
<button type="submit" id="add_contact">Add Contact</button>
</form>
<br/><br/>
<table>
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
</tr>
</thead>
<tbody id="contact_list"></tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment