Skip to content

Instantly share code, notes, and snippets.

@stamaniorec
Created June 8, 2016 08:48
Show Gist options
  • Save stamaniorec/10147475ecbedd012d913972e7741998 to your computer and use it in GitHub Desktop.
Save stamaniorec/10147475ecbedd012d913972e7741998 to your computer and use it in GitHub Desktop.
Playing with Backbone
<!DOCTYPE html>
<html>
<head>
<title>My webapp</title>
<style type="text/css">
#imp-table, #imp-table tr, #imp-table td {
border: 1px solid black;
border-collapse: collapse;
}
#imp-table td { padding: 10px; }
#addFoo { margin-bottom: 20px; }
</style>
</head>
<body>
<button id="addFooButton">Add New Foo</button>
<form id="addFoo"></form>
<form id="changeFoo"></form>
<script type="text/template" id="foo-template">
// <td><%= id %></td>
<td><%= title %></td>
<td><%= bar %></td>
<td><%= baz %></td>
<td><button class="edit">Edit</button></td>
<td><button class="delete">Delete</button></td>
</script>
<script type="text/template" id="table-template">
<thead>
<td>id</td>
<td>title</td>
<td>bar</td>
<td>baz</td>
<td></td>
<td></td>
</thead>
</script>
<script type="text/template" id="addFooTemplate">
<form>
<input name="title">
<input name="bar">
<input name="baz">
<input type="submit" class="submit">
</form>
</script>
<script type="text/javascript" src="jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="underscore-min.js"></script>
<script type="text/javascript" src="backbone-min.js"></script>
<script type="text/javascript" src="backform.js"></script>
<script type="text/javascript" src="main2.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment