Familiar with php framework CodeIgnitor. How can I load js files in view files?

Source: Internet
Author: User
Tags php framework
If you want to load a jquery file in the view File, the file cannot be found using the relative path display file. If you want to use the absolute path display 403, access is prohibited, but the file can be loaded in dreamwaver, I don't know how to load this file?

If you want to load a jquery file in the view File, the file cannot be found using the relative path display file. If you want to use the absolute path display 403, access is prohibited, but the file can be loaded in dreamwaver, I don't know how to load this file?

Reply content:

If you want to load a jquery file in the view File, the file cannot be found using the relative path display file. If you want to use the absolute path display 403, access is prohibited, but the file can be loaded in dreamwaver, I don't know how to load this file?

Generally, static files are stored in the root directory. You can use site_url ();. "/js/jquery. js? 6.1.3 "loading in this way

If Javascript is stored in/static/JS/jquery. js CI and has the site_url function, you can return the website address and splice it.

1. dreamware is a software and codeigniter is a php framework.
2. Place the js folder in the root directory of the website, and then write the script tag

Src ="

  Js/jquery. js? 6.1.3"

Thank you for your answers. The reason is that there is a. htaccess file in the application directory, which contains a sentence named Deny from all, so it cannot be loaded. Just go to the root directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.