I used to use Backbone.js as an easy MVC framework which have build-in routing support. Now I have moved and currently using Agility.js which doesn't routing support. So my question is, is there any alternative to Backbones.js's routing?
For reference on why I need this is because my "style" of writing is a one-page website that query the server for information.
A router is a JavaScript object that maps URLs to functions. The router calls a function based on the URL. In the past, a web application was a series of interconnected pages. This could either be static pages or dynamic pages that are generated on the server.
html. Also can I route to specific div/section html tag: user enter http://mysite/ru/contacts to display contacts section in index. ru.
Client-side routing is the internal handling of a route inside of your JS file that is rendered to the front end (or client). The reason client-side routing has become something more developers have been considering when creating their apps is due to the popularity of creating single-page applications (SPAs).
I've faced the same question just some weeks ago and wrote "Simrou", a very basic framework that does nothing but this kind of routing (hash-based). You can define the routes in Backbone's own style and then attach action handlers to GET, POST, PUT etc. requests (GET is basically a clicked link, POST etc. can be triggered by forms).
https://github.com/buero-fuer-ideen/Simrou
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With