官术网_书友最值得收藏!

What is a single-page app?

A single-page app implements this architecture for web clients: the JavaScript app launches from a web page and then runs entirely in the browser. All visual changes on the website happen as a reaction to user actions and the data received from the remote APIs.

It is called single-page because the server does not render pages for the client; it always delivers the same minimalistic markup required to bootstrap the JS app. All page rendering and navigation happens purely on the client, using JavaScript, which utilizes History APIs to dynamically swap page contents and URLs in the location bar.

The advantages that this approach gives are that the client can run something in the background between page transitions, and the client does not have to re-download and re-render the entire page in order to swap only the main content. Unfortunately, it also brings drawbacks, because now the client is responsible for all state changes. For the synchronization of such changes across the entire interface, it must know when to load the data and what particular data. In other words, a server-generated app is conceptually a way simpler thing, thanks to the REST service + JS client.

主站蜘蛛池模板: 平邑县| 陆河县| 汾西县| 台安县| 岚皋县| 江阴市| 永修县| 峨山| 宁强县| 塘沽区| 崇信县| 伽师县| 涡阳县| 南澳县| 桃源县| 竹北市| 泰和县| 柘城县| 余江县| 尚义县| 九台市| 温宿县| 沅陵县| 江阴市| 德保县| 霍山县| 乐清市| 马公市| 茶陵县| 永新县| 越西县| 白城市| 莲花县| 将乐县| 黑龙江省| 昌江| 沂水县| 长武县| 繁昌县| 高阳县| 银川市|