![]() |
Ajax posted data is not visible in controller method - 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 posted data is not visible in controller method (/showthread.php?tid=38582) |
Ajax posted data is not visible in controller method - El Forum - 02-11-2011 [eluser]Blue Sapphire[/eluser] Hi! Following is my ajax code: Code: jQuery.ajax({ My CI controller's method code is as follows: Code: function view() The Firebug is showing following post resuest : Quote:active=active_value The Firebug is showing following response : Quote:bool(false) Can someone guide me what Iam doing wrong. NOTE: CI version: 2.0 , jQuery version: 1.5 Thanks in advance Ajax posted data is not visible in controller method - El Forum - 02-12-2011 [eluser]CroNiX[/eluser] You are telling jquery to expect a json response, but you are not sending json from your controller. Also, I think you should probably leave the contentType the default. Ajax posted data is not visible in controller method - El Forum - 02-12-2011 [eluser]KarlBallard[/eluser] I admit I have zero experience with JSON but shouldn't your method be more like: Code: function view() |