When integrating the html page into the ci framework, loading css and js failed. After a long time, I found that the ci framework is the entrance framework. All requests for files in the framework need to be processed by index.php. When loading external css When working with js files, use the base_url() function to handle external links.
For example:
The base_url in the config configuration file is: " localhost:8080/project name/ "
Access application/resource/aaa.js in the controller File
relative pathAccess failed
1. Directly output in src
< ;script src= ".resource/aaa.js">
2. Use the base tag
to change base_url The output of () is placed in the < base href = ""/> tag, which is more convenient to call in the
page.