Skip to content

Instantly share code, notes, and snippets.

@zacharytamas
zacharytamas / gist:082e538784ebe07e40f9
Created June 13, 2014 19:24
Override window.location
(function () {
var _window = window;
(function () {
var window = {};
Object.defineProperty(window, 'location', {
get: function () { return _window.location; },
@colllin
colllin / backbone-auto-routing-example.html
Last active August 10, 2018 09:03
Automatic Backbone Routing - automatically capture links with relative URLs and route them through your Backbone Router. This method does not break any fallback server-side routing, because you're still using real URLs, i.e. `<a href="/my/app/page/4">See?</a>`. If a link can't be handled by any of your routers, it will fall through so the browse…
...
<nav>
<ul>
<li>
<a href="/my/app">Home</a>
</li><li>
<a href="/my/app/posts">Posts</a>
</li><li>
<a href="/my/app/posts/1">The First Post</a>
</li>