Skip to content

Instantly share code, notes, and snippets.

@lorenzoongithub
Created July 6, 2015 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzoongithub/07bed5e37d5d78be6da2 to your computer and use it in GitHub Desktop.
Save lorenzoongithub/07bed5e37d5d78be6da2 to your computer and use it in GitHub Desktop.
backbone.js
//
// the 'hello world' for backbone.js
// http://backbonejs.org/
//
load('http://code.jquery.com/jquery-1.7.1.min.js');
load('http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js');
load('http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js');
ListView = Backbone.View.extend({
initialize: function(){
_.bindAll(this, 'render');
this.render();
},
render: function(){
$(this.el).append('hello world');
}
});
div = document.createElement('div');
listView = new ListView({el: div});
if (div.innerHTML != 'hello world') throw '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment