Created
July 6, 2015 19:52
-
-
Save lorenzoongithub/07bed5e37d5d78be6da2 to your computer and use it in GitHub Desktop.
backbone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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