CodeIgniter Forums
Calling a Controller Method on click of a button from 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: Calling a Controller Method on click of a button from javascript (/showthread.php?tid=30174)



Calling a Controller Method on click of a button from javascript - El Forum - 05-05-2010

[eluser]keshavkuruva[/eluser]
Hi,

Can I call a controller method onclick of a button from javascript

Please let me know.

Regards,
Keshav Kuruva.


Calling a Controller Method on click of a button from javascript - El Forum - 05-05-2010

[eluser]BradEstey[/eluser]
You basically just want to load a page in the background.

To do this with jQuery you can either use the Load Function or if you need to post data to the controller then you can use the Post Function.