System Javascript library "external function" will not load local js files. And documentation missing information. +fix on forum #1322

websam101 opened this Issue May 4, 2012 · 1 comment


None yet
3 participants

I know it's experimental and the guide is really not up to date on this section but it would be nice to fix this to be able to script a template engine without hacking the core with every CI installations or making another function to load anything and missing a lot of good features...

The details of the bug were already posted it in the forum on September 2011...

My explanations are confusing but I don't know how to explain it another way.
I have posted it for the 2.0.3 version of CI but it's not fixed on the current 2.1.0
The logic of the loader is wrong, it double load the name of the file instead of loading the needed file.

Some examples:

This will fail since it's asking the same function:

javascript->external('jquery'); ?> javascript->external('jquery.js'); ?> jquery->script('jquery'); ?> jquery->script('jquery.js'); ?>

The results will be:
<... .../jqueryjquery"></script>
<... .../jquery.jsjquery.js"></script>
<... .../jqueryjquery"></script>
<... .../jquery.jsjquery.js"></script>

The config folder is ignored on this function as well:
$config['javascript_location'] = 'http://localhost/assets/js/';

CI user guide missing information: (Javascript Class)

Missing information on initializing the $data in the controller... (Loading with: $this->javascript->external() + $this->jquery->script()).

So less experimented users will only have errors when fallowing the user guide and inserting this in the layout without initializing before:

@narfbg narfbg added the Deprecated label Nov 12, 2014


narfbg commented Jan 20, 2015

Nobody has interest in supporting the JS library, and on top of that it's both experimental and already deprecated ... If anybody wants to fix this - submit a pull request please. Closing now.

@narfbg narfbg closed this Jan 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment