ruteurl
v0.0.3
Published
Routing for your OPA
Downloads
2
Readme
Rute
Hands on routing for one page apps
Version is 0.0.2
CDN
Include from unpkg
<script src="//unpkg.com/ruteurl"></script>
Example
Rute
.add('/about', function() {
console.log('about ');
})
.add('/user/:id/product/:prod', function(A, B) {
console.log(A, B);
})
.add(function() {
console.log('default');
})
.check() // Check if the page when it loads is pointing to a url
.listen() // Start listening to url changes
How to use
Use by linking to
<a href="#!/about">About</a>
or from javascript
Rute.goto('/user/54/product/car');
License: MIT
Philosophy: Merging the best from Krasimir Tsonevs "A modern JavaScript router in 100 lines" and regex dance from Routie