Single-page application

From Wiki @ Karl Jones dot com
Revision as of 06:41, 13 May 2015 by Karl Jones (Talk | contribs) (pushState() API)

Jump to: navigation, search

A 'single-page application' ('SPA') is a web application with a single web page.

In SPA, the user navigates through content much like navigating from one web page to another, but in fact the browser remains on a single page.

In an SPA, all of the necessary code -- HTML, JavaScript, and CSS -- is either retrieved with a single page load, or added dynamically (via JavaScript).

The page loads once, the web application is ready to use, with additional code added dynamically as needed.

The page does not reload at any point in the process, nor does control transfer to another page.

The URL in the browser address bar may change: this is done with JavaScript.

Interaction with the single page application typically involves dynamic communication with a web server.

  • The application makes a request to the server (typically because of a user action, or a timer)
  • The server responds with some data
  • The web application uses this data to update the browser

Modern web technologies (such as those included in the HTML5 pushState() API) can provide the perception and navigability of separate logical pages in the application.

External Links