Problems with SPA pages

for SPA pages, the traditional multi-page application process is as follows: enter the URL, send the url corresponding to the url, to a different controller, through regular matching, and then return the data to the front end at the back end.
so for SPA, routing is written by the front end, how does the data given by the back end be sent to the front end? How does the front-end route load data? How to switch pages so quickly.


use ajax


for SPA pages, the traditional multi-page application process is as follows: enter the URL, send it to a different controller, through regular matching to the url corresponding to the url, and then return the data to the front end to the front end.

you did not describe that this part is actually wrapped in a http service.

so for SPA, routing is written by the front end, how does the data given by the back end be sent to the front end?

similarly, a http service is also needed here, such as the commonly used nginx , so the backend (such as nginx ) gets the url return data.

how does the front-end route load data?

there are hash mode routes and history pattern routes, that is, http://xxx/-sharp/abc and http://xxx/abc.
the former is routed through js at the front end, while the latter is somewhat different. The difference is that if it is refreshed or accessed directly through url , the backend needs to return the main page html , such as index.html , and then route to the response child page on the browser side.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37686-2c084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37686-2c084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?