javascript - Front-end page problem: Divide a page into several pages to write, but when running an index, the complete page is displayed
女神的闺蜜爱上我2017-06-07 09:24:23
0
5
829
Front-end page problem: Divide a page into several pages to write, but when running an index, the complete page is displayed. What technology is this? How to achieve it
Dear, what you are talking about should be to divide the page into modules, and then load them separately according to the page module; there are actually many ways to achieve this: 1. Directly use iframe to nest subpages 2. Asynchronously load the page module through ajax and refresh the page asynchronously Partial 3. Use js framework or template plug-in, such as: angular, Juicer.js...
Template inheritance, it’s faster to write using a framework
Dear, what you are talking about should be to divide the page into modules, and then load them separately according to the page module; there are actually many ways to achieve this:
1. Directly use iframe to nest subpages
2. Asynchronously load the page module through ajax and refresh the page asynchronously Partial
3. Use js framework or template plug-in, such as: angular, Juicer.js...
You can consider using a framework to write, such as angular.js, vue.js.
Can be made into a SPA single page
Write these pages into js, and then dynamically insert them into the body