The environment has designed the following content in the navigation bar navbar. A simple design idea is: click the button above (such as aboutblog) and maincontainer loads the front-end page from the background. the original design idea used the CodeIgniter framework, which was intended to be in the front...Environment
The following navigation bar is designed:
The content in navbar is the body content.
Requirement
A very simple design idea is: click the above button (such as about/blog), main container willFrom the background
Load the front-end page.
Original design ideas
The CodeIgniter framework is used.Ajax
Binds all buttons in the navigation bar, and each button triggers an ajax request. the backend writes a public function to process front-end ajax requests.$this->load->view('xxx')
Reload the Main INER page and implement php modularization (header. js/footer. js.. etc ).
Problem
Because the container loaded each time is different, the static files used are as follows:css|javascript|img
Loading in different INER is different, so the header and footer templates cannot be unified. If all static resources are written in the php template, the page will inevitably becomeLoading time is too long
.
I have thought of an alternative solution. each container adds the nav label to ensure that different static resources are loaded separately. However, it is complicated to maintain the code after molding, code duplication is not efficient.
Is there any better solution ??
Reply content:Environment
The following navigation bar is designed:
The content in navbar is the body content.
Requirement
A very simple design idea is: click the above button (such as about/blog), main container willFrom the background
Load the front-end page.
Original design ideas
The CodeIgniter framework is used.Ajax
Binds all buttons in the navigation bar, and each button triggers an ajax request. the backend writes a public function to process front-end ajax requests.$this->load->view('xxx')
Reload the Main INER page and implement php modularization (header. js/footer. js.. etc ).
Problem
Because the container loaded each time is different, the static files used are as follows:css|javascript|img
Loading in different INER is different, so the header and footer templates cannot be unified. If all static resources are written in the php template, the page will inevitably becomeLoading time is too long
.
I have thought of an alternative solution. each container adds the nav label to ensure that different static resources are loaded separately. However, it is complicated to maintain the code after molding, code duplication is not efficient.
Is there any better solution ??