CodeIgniter Forums
communication with javascript - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: communication with javascript (/showthread.php?tid=60212)



communication with javascript - El Forum - 02-05-2014

[eluser]Unknown[/eluser]
Hello all

I have a view that's a mix of Javascript and PHP.

I want to take some info stored in Javascript, send it to a CI helper, send the results back to Javascript and display them in the view.

I'm at a loss as to how to make this happen.

Has anyone done anything like this before?

Anon


communication with javascript - El Forum - 02-05-2014

[eluser]CroNiX[/eluser]
Sure, it's fairly common. You just use ajax in your javascript to call a CI controller/method url (which can load/use helpers or anything else), and have that do whatever server side processing that needs to be done and then return JSON, HTML or whatever you need back.


communication with javascript - El Forum - 02-05-2014

[eluser]CroNiX[/eluser]
Check this thread.