CodeIgniter Forums
Ajax From CI Controllers? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Ajax From CI Controllers? (/showthread.php?tid=34892)



Ajax From CI Controllers? - El Forum - 10-12-2010

[eluser]ShoeLace1291[/eluser]
I was thinking about writing my own ajax library. I was wondering if it is possible to display ajax data from CI Controllers? For example, if the url you called in the javascript ajax function led to a function within a controller class within a CI installation.

Example:
example.com/index.php/ajax/test


Ajax From CI Controllers? - El Forum - 10-12-2010

[eluser]CroNiX[/eluser]
If you mean, can you make an ajax request to a CI controller/method and receive data back...yes.
Its not really any different than any other request to the server...you are just sending a request like /controller/method/p1/... and capturing the response back and doing something with it, like display it or alter the DOM or something.