https://github.com/lovesaroha/lrouter.js
lrouter is a lightweight javaScript library to provide an API for handling hash routes.
https://github.com/lovesaroha/lrouter.js
html javascript-library router
Last synced: 3 months ago
JSON representation
lrouter is a lightweight javaScript library to provide an API for handling hash routes.
- Host: GitHub
- URL: https://github.com/lovesaroha/lrouter.js
- Owner: lovesaroha
- License: gpl-3.0
- Created: 2021-09-16T11:39:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T12:03:58.000Z (over 4 years ago)
- Last Synced: 2025-07-18T02:20:28.759Z (6 months ago)
- Topics: html, javascript-library, router
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lrouter Javascript Library
lrouter is a lightweight javascript library to provide an API for handling hash routes.
## Installation
```html
```
## Usage
```js
// Create a router.
let router = lrouter.Create();
// Define routes.
router.Add("/#/" , function() {
console.log("Home Page");
});
router.Add("/#/login" , function() {
console.log("Login Page");
});
// Routes with parameters (/#/articles?category=sports&limit=10).
router.Add("/#/articles" , function(parameters) {
console.log("Articles Page");
let category = parameters.category;
let limit = parameters.limit;
});
```