Question

I have an issue including JQuery on my CodeIgniter project. By default, Jquery is included but I can not be able to link with it. I am trying this:

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

Libraries like database, email or profiler are stored in system/libraries folder and it is ok, no problem. But jquery is in system/libraries/javascript folder and I get this error in browser.

Fatal error: Class 'CI_Javascript' not found in C:\Users\dani\XAMPP\htdocs\CodeIgniter_2.1.4\system\libraries\javascript\Jquery.php on line 27

I am working on Windows, so capitalizing is not a problem. It is like CI_Javascript class did not exist.

The only way I solved this issue was downloading JQuery manually, and later, incluiding with a link tag in HTML files but I want to autoload always, is more comfortable.

Have anyone had the same issue? Thanks.

Was it helpful?

Solution

You needn't specify jQuery in autoload, just load Javascript library.

From from manual:

Currently, the only available library is jQuery, which will automatically be loaded like this:

$this->load->library('javascript');

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top