What is client side routing and how is it used?

I would be glad if someone can answer the following questions.

  • How it works?
  • Why is this necessary?
  • What does it improve?
+10
client-side url-routing
Apr 17 '12 at 11:18
source share
2 answers

Client-side routing is the same as server-side routing, but it runs in the browser.

In a typical web application, you have several pages that map to different URLs, and each of the pages has some logic and a template that is then displayed.

Client-side routing simply launches this process in the browser using JavaScript for logic and some JS-based template engine or other similar approaches for rendering pages.

It is commonly used in single-page applications, where server-side code is mainly used to provide a RESTful API that uses client-side code through Ajax.

+12
May 6 '12 at 18:58
source share

I tried to create a one-page application and found out about client-side routing.

By implementing client-side routing, I was able to achieve the following

  • The front and back buttons in the browser started working for my one-page JavaScript application. This was very important when accessing the page from a mobile browser.
  • The user was able to add / send a URL that was previously unavailable.
+4
May 6 '14 at 9:42
source share



All Articles