Solution to failure to load css and js files in the php ci framework_PHP tutorial

WBOY
Release: 2016-07-13 10:37:06
Original
928 people have browsed it

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.

Copy code The code is as follows:

< base href = " "/>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/736818.htmlTechArticleWhen integrating the html page into the ci framework, loading css and js failed. After a long time, I found the ci framework. It is the entrance framework. All requests for files in the framework need to be processed by index.php...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!