Welcome Guest, Not a member yet? Register   Sign In
Javascript with Code Igniter

[eluser]Alfredo Palhares[/eluser]
Hello, I am first time using Code Igniter and I am felling very whit it.

But i having problems no using externals javascript files in my views

When i make:
<[script tag] type="text/javascript" charset="utf-8" src="form_utils.js"></[script tag]>
Note: The file is the same directory as in the view file.
Note 2: I changed the script tag because the forum remove my code if i don't do that.

How do use it?
Is there any documentation that i can read about that?
I searched the hole user manual i didn't found anything.

Thanks already,
Alfredo Palhares

I think what you're after is
src="&lt;?php echo base_url(); ?&gt;application folder/view folder/file name.js"

File paths are relative to the index.php file since that's what runs the show. You may find it helpful adding a leading slash to the beginning of your source. After you get your feet wet with CI, you may want to check out Carabiner. A link is provided in my signature, that will minify/combine your css/js files. You can add files dynamically in your controller/views, or do it statically.

Theme © iAndrew 2016 - Forum software by © MyBB