Member Avatar for RudyM

What is the best practice for including JQuery in Codeigniter? I've tried including the following line in my controller code:

$this->load->library('javascipt/jquery');

But, when the page loads, I get

Unable to load the requested class: Jquery

My setup is using xampp, CodeIgniter folder "CI" is located in /htcdocs/ci/. Thanks in advance.

jQuery is a front-end javascript library. You are trying to load it the way you would load a PHP CodeIgniter library. Put this in the HEAD section of your HTML template:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
Member Avatar for RudyM

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.