CodeIgniter and Javascript/Jquery Library

前端 未结 9 841
粉色の甜心
粉色の甜心 2021-02-12 11:51

As title said, I\'m trying to figure out how to use javascript and jquery libraries on CI.

Following instruction in the docs, I load the library in my controller:

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 12:18

    I had the same problem, and found :

    load->library('javascript'); ?>
    load->library('javascript/jquery'); ?>
    

    on https://ellislab.com/forums/viewthread/181742/#860506

    Because jquery is in javascript folder.

    Or

    $autoload['libraries'] = array('database', 'session', 'javascript', 'javascript/jquery');
    

    In the autoload.php file.

    That solved the problem of loading the librairy.

提交回复
热议问题