how to jquery load and use in codeigniter? |
[eluser]nickname[/eluser]
Hello Everybody! i'm nickname. I had a project was using codeigniter, i built a layout and all pages used it and i used jquery to load contents(load another controller were working) into layout' contents. but those controllers could not use jquery. so : 1). i had problem with jquery in codeigniter. i could not load jquery to codeigniter and i didn't know how to load it. 2). can you help me for these problem.? it is important for me. thanks in advance nickname need your help.
[eluser]nickname[/eluser]
ok i saw your website. but i don't want to load jquery all view_pages of controller. i just want once load and use it all view_pages of controller. can i autoload jquery when project run? can u help me more... i will show my project layout later thanks..
[eluser]Jan_1[/eluser]
you could load jquery in header from google for example. header and footer have mostly the same content on all sites. maybe you cut your views into 3 parts/files. the following is just systematicaly - hope I do no mistakes. tell me if it is a help or if i can do more. some_controller.php Code: function index() template_view.php Code: <?php header.php Code: // all header stuff and... content.php Code: <?php home.php Code: <?php
[eluser]RaZoR LeGaCy[/eluser]
You can use an autoload but what if you do not need jquery or jquery ui on every single page. I do the same as Jan and only load jquery and other javascript when needed. It will be in one central header file anyway. I agree with Jans' method.
[eluser]nickname[/eluser]
hi! the good idea but my project didn't use header and footer. it was a layout (included header, footer and content) just used jquery to load the controller were working and got that result of controller's contents to displayed in content in layout. but the controller that i loaded could not use jquery except layout could use. thanks u again that helped me. i have want u help me more about this. - how can i autoload jquery library in codeigniter? - what can i do with these problem? thanks in advance.
[eluser]Jan_1[/eluser]
mmh,.. Quote: - how can i autoload jquery library in codeigniter?userguide: "To autoload resources, open the application/config/autoload.php file and add the item you want loaded to the autoload array. You'll find instructions in that file corresponding to each type of item." Quote:- what can i do with these problem?well, which one do you have then? maybe think about structure.
[eluser]nickname[/eluser]
i still not autoload it. can u show me some config code.? ☺
[eluser]nickname[/eluser]
hi! i did it. thanks so much for your help. see you later. |
Welcome Guest, Not a member yet? Register Sign In |