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
- Host: GitHub
- URL: https://github.com/exane/js-router
- Owner: exane
- Created: 2014-02-22T21:32:43.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-23T16:15:29.000Z (almost 12 years ago)
- Last Synced: 2025-02-09T13:32:50.549Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 391 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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");