Created
February 23, 2011 11:00
-
-
Save froots/840290 to your computer and use it in GitHub Desktop.
Simple test case demonstrating issue 228 for documentcloud/backbone
This file contains hidden or 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
var AppView = Backbone.View.extend({ | |
display: function(text) { | |
$('#app').text(text); | |
} | |
}); | |
var AppController = Backbone.Controller.extend({ | |
initialize: function() { | |
this.view = new AppView(); | |
}, | |
routes: { | |
"": "index", | |
"foo": "foo" | |
}, | |
index: function() { | |
this.view.display("index"); | |
}, | |
foo: function() { | |
this.view.display("foo"); | |
} | |
}); | |
var controller = new AppController(); | |
Backbone.history.start(); |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<ul> | |
<li><a href="#">Index route</a></li> | |
<li><a href="#foo">Foo route - doesn't work on IE7</a></li> | |
</ul> | |
<div id="app"></div> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> | |
<script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.4/underscore-min.js"></script> | |
<script src="http://ajax.cdnjs.com/ajax/libs/backbone.js/0.3.3/backbone-min.js"></script> | |
<script src="app.js"></script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment