In the integration of HTML page inside the CI frame, loading css and JS failed, the following analysis and solve the problem
In the integration of HTML page inside the CI frame, loading css and JS failed, get a long time to find the CI framework is the framework of the portal, all the files in the framework of the request need to go through index.php processing, when loading external CSS and JS file to use the Base_ The URL () function handles external links. For example, the Base_url in config profile is: "localhost:8080/project name/" Access Application/resource/aaa.js file relative path in controller <script src= "Res Ource/aaa.js "></script> access failed 1, directly in src output <script src=" <?php echo Base_url ();? >.resource/aaa.js "></script> 2, use the base tag to place the output of Base_url () in < Base href =" <?php echo base_url ();? > "/> tags inside, so the page inside the call is more convenient. The code is as follows: < Base href = "<?php echo base_url ();? > "/> <script src=" Resource/aaa.js "></script>