Routing Background

In notebook:
FrontEndMasters BackboneJS
Created at:
2016-06-10
Updated:
2016-06-10
Tags:
libraries JavaScript Fundamentals
Routing is the part that maps the least well to the MV* pattern.

Takes you back to a state based on the url hash

Single Page Apps.

Payload : download all the code upfront, read the URL and reproduce some state

Actions in the router should be repeatable.

Hash fragments

classic example: twitter.com/status#!/2305293
you have hash change events

now there's the 

HTML5 History API.

push/pop history state. Works with the back button. 

Backbone supports both routing