[eluser]eokorie[/eluser]
Hi
Try this:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Javascript_test extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('javascript');
$this->load->library('jquery', FALSE);
}
function index() {
$data = array();
$this->jquery->script('/assets/js/jquery/jquery.js', TRUE);
$js = $this->javascript->hide('#myDiv');
$this->javascript->output($js);
$this->javascript->compile();
$this->load->view('index',$data);
}
}
Your html would the look like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>Javascript Test</title>
<?php echo isset($script_head) ? $script_head : ''; ?>
</head>
<body>
<div id="myDiv">
This is my div!
</div>
<?php echo isset($library_src) ? $library_src : ''; ?>
<?php echo isset($script_foot) ? $script_foot : ''; ?>
</body>
</html>
Hope this helps!