[eluser]Lone[/eluser]
A nice and easy (dirty?) way you could achieve this is create a function in a controller that loads a view that is really the js file but in php and then mask it with htaccess
And because that made no sense heres a sample
In some controller ('manage' for this sample)
Code:
function js() {
$this->load->view('../../js/myscript'); // of course the ../../ is dependant on your application folder location
}
Put all of your JS in the myscript.php file in the /js directory and then you have two options for loading it. You can do it raw like:
Code:
< script type="text/javascript" src="http://www.mysite.com/manage/js">
Or make it neater using htaccess..
Code:
// htaccess
RewriteRule js/myscript.js$ manage/js
// html
< script type="text/javascript" src="http://www.mysite.com/js/myscript.js">