CodeIgniter: How do I include a .js file in view?

前端 未结 7 1049
粉色の甜心
粉色の甜心 2020-12-30 12:38

Where and how do I include .js files in Views in CodeIgniter?

I have tried this:



        
7条回答
  •  北海茫月
    2020-12-30 13:38

    It's not the "index.php" file that is the view. The view is whatever is loaded in your controller when you do a

    $this->load->view("viewname");

    The file "viewname.php" can then include the .js files, just as a normal .html (or .php) file would:

    
    
                                     
                  
提交回复
热议问题