-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_backbone.html
More file actions
executable file
·82 lines (72 loc) · 2.74 KB
/
sample_backbone.html
File metadata and controls
executable file
·82 lines (72 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<meta http-equiv = "X-UA-Compatible" content = "IE = edge,chrome = 1">
<title>Hello World using Backbone.js</title>
</head>
<body>
<!-- ========= -->
<!-- Your HTML -->
<!-- ========= -->
<div id = "container">Loading...</div>
<ul>
<!-- <li></li> -->
</ul>
<form id="addPerson" action="">
<input type="text" placeholder="Name of the person">
<input type="submit" value="Add Person">
</form>
<script id="personTemplate" type="text/template">
<span><strong><%= name %></strong> (<%= age %>) - <%= occupation %></span>
<button class="edit">Edit</button>
<button class="delete">Delete</button>
</script>
<!-- ========= -->
<!-- Libraries -->
<!-- ========= -->
<!-- <script id="personTemplate" type="text/template">
<strong><%= name %></strong> (<%= age %>) - <%= occupation %>
</script> -->
<script src = "https://code.jquery.com/jquery-2.1.3.min.js"
type = "text/javascript"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"
type = "text/javascript"></script>
<script src = "https://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"
type = "text/javascript"></script>
<!-- <script type="text/javascript" src="./main.js"></script> -->
<script type="text/javascript" src="./todo.js"></script>
<!-- =============== -->
<!-- Javascript code -->
<!-- =============== -->
<script type="text/javascript">
// constructor
// function Person(first, last) {
// this.first = first;
// this.last = last;
// }
// Person.prototype.fullName = function() {
// console.log(this.first,this.last);
// return this.first+' == '+ this.last;
// };
// var p = new Person('vinoth','A');
// p.fullName();
</script>
<!-- <script type = "text/javascript">
var AppView = Backbone.View.extend ({
// el - stands for element. Every view has an element associated with HTML content, will be rendered.
el: '#container',
// It's the first function called when this view is instantiated.
initialize: function() {
this.render();
},
// $el - it's a cached jQuery object (el), in which you can use jQuery functions to push content.
//Like the Hello TutorialsPoint in this case.
render: function() {
this.$el.html("Hello TutorialsPoint!!!");
}
});
var appView = new AppView();
</script> -->
</body>
</html>