[eluser]Unknown[/eluser]
I am new to codeigniter. I am not able to use javascript and jquery library in codeigniter.
i have searched alot on google and forums but could not get the answer.
tried this way..
controller
Code:
class jquery_demo extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('javascript');
}
function index()
{
$this->javascript->click('#button', "alert('Hello!');");
$this->javascript->compile();
$data['library_src'] = $this->load->get_var('library_src');
$data['script_head'] = $this->load->get_var('script_foot');
$this->load->view('js_test',$data);
}
}
view..
Code:
<!DOCTYPE html>
<html>
<head>
<?php echo $library_src;?>
<?php echo $script_head;?>
[removed]
[removed]
<title>Jquery test</title></head>
<body>
<?php
echo form_open();
echo form_button("button","button","id='button'");
echo form_close();
?>
</body>
</html>
but no action is performed by clicking on button....
can anyone give me a solution please...