Joined July 2012
·

Benjamin Mock

Kaiserslautern, Germany
·
·

That's a pretty cool idea!

But instead of just echoing the output, you should rather use:

$this->output
            ->set_content_type('text/javascript')
            ->set_output($contents);

Also there's an error in the last of your snippets. It need to be:

<script type="text/javascript" src="<?php echo site_url('jsloader/my_javascript_file.js');?>" />

And maybe someone will this thing for the routes.php, too:

$route['jsloader/(:any)']           = "jsloader/file/$1";
Achievements
29 Karma
0 Total ProTip Views
Interests & Skills