0.0.12 • Published 11 years ago

pather v0.0.12

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

Pather.js

Drop-dead simple window.location.pathname listener

Build Status

Disclaimer: This is work in progress

Works in browsers supporting the HTML5 History API, for older browsers, a polyfill like devote/HTML5-History-API is required.

Examples

Simple

Path.on("/foo/bar", function() {
  console.log("Enter /foo/bar");
})

window.history.pushState({}, null, "/foo/bar")

Named parameters (Sinatra/Backbone style)

View this example in jsfiddle

Path.on("/foo/:a/:b", function(a, b) {
  console.log("Enter /foo/"+a+"/"+b);
})

window.history.pushState({}, null, "/foo/bar/baz")
0.0.12

11 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago