How to get the jSON data value and pass it to a Conroller? - 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: How to get the jSON data value and pass it to a Conroller? (/showthread.php?tid=59646) |
How to get the jSON data value and pass it to a Conroller? - El Forum - 10-30-2013 [eluser]rochellecanale[/eluser] just want to ask about my problem. I am a beginner in using jquery. My problem is I want to get the json string from my jquery ajax request but I don't know how. Because I want to check if the json string values are correct. Here's my code in jquery ajax: Code: $('#search-btn').on('click',function(){ This is the code for the events. Code: <table border="1" 100%; align: left" cellpadding="10" cellspacing="10" align="left"> This is my code for accessing the controller Code: public function searchItem(){ What I want to get is: In my ajax. There is a data that contains the value of keyword and data filter. Now What I need to do is get the data_filter value and pass it to the controller. How to get the jSON data value and pass it to a Conroller? - El Forum - 10-31-2013 [eluser]stefenw[/eluser] Quote:Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead. i use this returning json from controller Code: $x = $this->input->post('x'); if result as row Code: $.ajax({ x will contain abc if you need to loop trough returned json use this Code: $.each(data.datacallback, function(k, item) { |