using ajax |
[eluser]Thorpe Obazee[/eluser]
It's PHP. It works the same way with or without CI.
[eluser]pedro_sland[/eluser]
There is no built-in recommended way. I have tried a few ways but have found it depends on what sort of ajax you are doing. If its to get or set a lot of data instead of html then I create a new method or even controller for it. If its to compliment the html and the action is the same, then I create it in the same method and just use an if to test for ajax to decide whether to load a view or return json.
[eluser]jdfwarrior[/eluser]
[quote author="bargainph" date="1241516717"]It's PHP. It works the same way with or without CI.[/quote] +1. CodeIgniter is nothing but a framework. It's still just PHP/HTML/CSS in the end. Whatever way you did ajax before.. It's done the exact same way with CodeIgniter.
[eluser]Jagar[/eluser]
I use xajax toolkit, it's really good and works great. www.xajaxproject.org. Download the toolkit and put it in the application/libraries/xajax and whenever you want to load it you just do $this->load->library('xajax'); it depends where it is located, so you may have to change it. You don't do any javascript stuff, all that is generated by xajax. You should try it.
[eluser]Jagar[/eluser]
Yea Jquery is amazing as well, I'm currently learning that, and it's amazing what you can do with it.
[eluser]sl3dg3hamm3r[/eluser]
[quote author="Jagar" date="1241549091"]Download the toolkit and put it in the application/libraries/xajax and whenever you want to load it you just do $this->load->library('xajax'); it depends where it is located, so you may have to change it.[/quote] Hey there I have troubles loading this library. I renamed xajax.inc.php into xajax.php. When I do $this->load->library('xajax/xajax'); I would get a: Fatal error: Cannot redeclare class xajax in [...]\system\application\libraries\xajax\xajax.php on line 59 What am I doing wrong? Oliver
[eluser]Jagar[/eluser]
When you get that error message, means you are loading it in two places, make sure you have not declared anywhere else, that's how I got mine working.
[eluser]sl3dg3hamm3r[/eluser]
Basically I only tried the small example-snippet which I found somewhere here in the forum: Code: function index() { I don't call this class somewhere else... |
Welcome Guest, Not a member yet? Register Sign In |