CodeIgniter Forums
XAJAX and CodeIgniter Reactor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: XAJAX and CodeIgniter Reactor (/showthread.php?tid=39299)

Pages: 1 2


XAJAX and CodeIgniter Reactor - El Forum - 03-07-2011

[eluser]IgnitedCoder[/eluser]
I'm not a guru at it but I have some experience using XAJX and CI with some success. I've started this topic to help other CI devs get upto speed with it quickly.


XAJAX and CodeIgniter Reactor - El Forum - 03-07-2011

[eluser]IgnitedCoder[/eluser]
NOTE this is XAJAX 0.6X beta 1.

So heres how to get XAJAX working on CI without too much of a hassle.

1. Grab the libraries.zip file and unzip it to your application/libraries folder.
2. Grab the xajax_js.zip folder and unzip it to your sites root folder.

You're all set to load xajax... either via autoload or as follows:

Controller Code.
Code:
function index(){
$this->load->library('xajax');
$this->xajax->configure("javascript URI", base_url());
$this->xajax->register(XAJAX_FUNCTION, array('say_hello', &$this, 'say_hello'));
$this->xajax->processRequest();
}

function say_hello(){
$objResponse = new xajaxResponse();
$objResponse->Assign("div_id_in_view", "innerHTML", $this->load->view('_partials/comment/post',$data,true)); //this dynamically loads a form into the div.
//OR
$objResponse->Assign("div_id_in_view", "innerHTML", "Just saying hello from XAJAX.");
return $objResponse;
}

View Code.
In header section of html of course.
Code:
<?=$this->xajax->printJavascript();?>

Hope this helps...


XAJAX and CodeIgniter Reactor - El Forum - 03-07-2011

[eluser]IgnitedCoder[/eluser]
Could'nt upload all the files... heres libraries.tgz file for XAJAX.

Brendan


XAJAX and CodeIgniter Reactor - El Forum - 07-21-2011

[eluser]CopyJosh[/eluser]
If you're using CSRF, this won't work. Took me awhile to figure out but for for XAJAX and CI 2.0 with CSRF, the following will probably be more helpful:

http://www.gen.newrandom.com/2011/07/21/codeigniter-and-xajax-csrf-fix/


XAJAX and CodeIgniter Reactor - El Forum - 07-21-2011

[eluser]IgnitedCoder[/eluser]
Excellent catch, please send along your changes to the source files. Quick upload to this post would be most appreciated. Also very well documented, thanks.


XAJAX and CodeIgniter Reactor - El Forum - 07-22-2011

[eluser]CopyJosh[/eluser]
The files are attached or you can find them individually (with the zip) here:

http://public.newrandom.com/examples/codeigniter/


XAJAX and CodeIgniter Reactor - El Forum - 03-28-2012

[eluser]redcoder[/eluser]
I can't download the file ??


XAJAX and CodeIgniter Reactor - El Forum - 03-28-2012

[eluser]CopyJosh[/eluser]
From the forum or http://gen.newrandom.com?


XAJAX and CodeIgniter Reactor - El Forum - 03-28-2012

[eluser]redcoder[/eluser]
Thanks summer student.
what about the xajax_js.zip ?


XAJAX and CodeIgniter Reactor - El Forum - 03-29-2012

[eluser]InsiteFX[/eluser]
You need to go to Xajax and download the beta 06