Skip to content

Instantly share code, notes, and snippets.

@christurnertv
Created September 18, 2014 18:17
Show Gist options
  • Save christurnertv/119658c5a3642d716469 to your computer and use it in GitHub Desktop.
Save christurnertv/119658c5a3642d716469 to your computer and use it in GitHub Desktop.
Backbone hello world.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="http://backbonejs.org/backbone-min.js"></script>
</head>
<body>
<div id="main">
</div>
<script>
var PageNavView = Backbone.View.extend({
el: '#main',
initialize: function () {
this.render();
},
render:function () {
this.$el.html('hello');
return this;
}
});
var pnv = new PageNavView();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment