Welcome Guest, Not a member yet? Register   Sign In
Implementing code
#1

[eluser]rvent[/eluser]
Hello,

i ve been doing CI for a few now and even when i am familiar with most of the stuff i am no expert. I ve been reading a lot about JavaScript frameworks and desided to go with Jquery and ExtJS.

However, i cant find a clear picture of where or how i should put the JS code into CI... Does it go into the view file..? the controller..? model...?

So if anyone has a link that has a simple example of how to use JS with CI please let me know. I just want to know where to write the JS code....

Maybe it depends on the which JS framework i use.. I just dont know...

Thanks and sorry if this has been posted before, but i just couldnt find it...
#2

[eluser]xwero[/eluser]
Yes it goes in the view. If you are working with javascript you have to look at you site as if it where all static pages because that is what javascript sees.

According to the Yslow recommendation a lot of javascript developers take seriously it's best to put the javascript near the bottom of the page. So if you use a footer view it's best to put link to the javascript file(s) there.




Theme © iAndrew 2016 - Forum software by © MyBB