An open API service indexing awesome lists of open source software.

https://github.com/exane/js-router

A small jQuery based router
https://github.com/exane/js-router

Last synced: 2 months ago
JSON representation

A small jQuery based router

Awesome Lists containing this project

README

          

JS router
=========

(requires jQuery)

Syntax:

Construct:

new Router( [optional] string viewSelector );

if no parameter given, default would be "body" as standard selector.

Methodes:

.when( string routeUrl, string templateUrl )

.otherwise( string templateUrl )



example:

var route = new Router("#view");

route.when("home", "template/home.html")

.when("news", "template/news.html")

.when("about", "template/about.html")

.when("test", "template/test.html")

.otherwise("template/404.html");