Welcome Guest, Not a member yet? Register   Sign In
Javascript Library - Loading external files
#1

[eluser]Unknown[/eluser]
I have just started testing the javascript library and have encountered a problem. I can't find anything on the user guide explaining how to use the $this->javascript->external() function. I looked through the library and found external() myself.

The problem I have is when I use
Code:
echo $this->javascript->external('example.js');
I get the following result:

Code:
< script type="text/javascript" charset="utf-8" src="mydomain.com/js/example.jsexample.js" >< /script >

I believe the problem is on lines 614 - 621. It checks whether $external_file is empty if not the $this->_javascript_location variable becomes that value (otherwise it's defined by CI_Config. But then when it comes to actually rendering the returned string
Code:
$str = $this->_open_script($this->CI->config->slash_item('base_url').$this->_javascript_location.$external_file);
$this->_javascript_location.$external_file are both the same value... Why? Am I using the library wrong? Have I missed something? Can anybody help me do this correctly?




Theme © iAndrew 2016 - Forum software by © MyBB