When the HTML page is integrated into the CI frame, loading css and JS fails, and I find that the CI framework is the portal framework,
All requests for files in the framework need to be processed by index.php, and when loading external CSS and JS files, make
Use the Base_url () function to handle external links.
Like what:
The base_url in the Config profile is: "localhost:8080/Project name/"
accessing application/resource/aaa.js files in the controller
Relative path <script src= "Resource/aaa.js" ></script> access failed
1, directly in the SRC output
<script src= "<?php echo Base_url ();? >.resource/aaa.js "></script>
2. Use Base label
Place the output of the Base_url () in the < Base href = "<?php echo base_url ();? > "/> tag inside, so in
The page inside the call is more convenient.
<base href = "<?php echo base_url ();? > "/>
<script src=" Resource/aaa.js "></script>