As title said, I\'m trying to figure out how to use javascript and jquery libraries on CI.
Following instruction in the docs, I load the library in my controller:
Not sure why you have to load your js file via controller and then echoing it in your view. You can just load ur js file using HTML tags directly in your view. Passing data from controller and echoing it in view is mostly used when your variable's value is dynamic/ needs to be loaded from databases etc.