Skip to content

Instantly share code, notes, and snippets.

@froots
Created February 23, 2011 11:00
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 froots/840290 to your computer and use it in GitHub Desktop.
Save froots/840290 to your computer and use it in GitHub Desktop.
Simple test case demonstrating issue 228 for documentcloud/backbone
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();
<!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