I would like to use jQuery inside my CodeIngiter Project. I dont know how to include the js file.
I would like to have something like below in my view
<script src='<?php echo base_url().APPPATH ?>js/jquery.js'></script>
<script src='<?php echo base_url().APPPATH ?>js/my-js.js'></script>
Firstly, create a folder to put it in. Then you could use a template system like this one.
This lets you add js files either globally in the main template, or by a controller/function basis using the syntax $this->template->add_js('assets/js/jquery.js');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With