JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<div id="view-goes-here">
    <a href="/">home</a>
    <a href="/questions">questions</a>
    <a href="/justlink">just link</a>
</div>

CSS

#view-goes-here {
    padding: 50px;
    border: 1px solid black;
}

JavaScript

var App = Backbone.Router.extend({
    routes: {
        "": "homepage",
        "questions": "questions"
    },
    homepage: function() {
        console.log('why');
    },
    questions: function() {
        console.log('this is not working?');
    }
});
var the_app = new App();
$("a").click(function(ev) {
    the_app.navigate($(this).attr("href"), true);
    return false;
});
Backbone.history.start({
    pushState: true
});