[eluser]ejangi[/eluser]
I personally don't think a model is that answer for delivering up JavaScript etc as models are "supposed" to be data containers unless you're talking about delivering up data as JSON or something??? I would say it is more likely that a library or helper should deliver the JavaScript/HTML, but I am intrigued with your idea about JavaScript in a view.
Models can call models:
Code:
class Blogmodel extends Model {
var $title = '';
var $content = '';
var $date = '';
var $CI = null;
function Blogmodel()
{
// Call the Model constructor
parent::Model();
// Here's the punch line:
$this->CI =& get_instance();
$this->CI->load->model('myothermodel');
}
}