JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://dl.dropbox.com/u/16292713/js/backbone.js"></script>
<script src="http://dl.dropbox.com/u/16292713/js/underscore.js"></script>
JavaScript
var RefreshingView = Backbone.View.extend({
initialize: function() {
this.model.on('change', this.render, this);
},
render: function() {
this.$el.html(this.model.get('text'));
}
});
var MyModel = Backbone.Model.extend({
text: null
});
var m = new MyModel({ text: new Date().toString() });
var myView = new RefreshingView({model: m, el: 'body'});
myView.render();
setInterval(function() {
m.set({text: new Date().toString()});
}, 1000);