0

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.

Edited by Dani: Wrong forum

2
Contributors
2
Replies
10
Views
2 Years
Discussion Span
Last Post by RudyM
2

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>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.