![]() |
Ajax & Class Output - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Ajax & Class Output (/showthread.php?tid=69818) |
Ajax & Class Output - Wertos - 01-21-2018 I'm trying to give data through an output class PHP Code: $this->output ![]() As a result I get problems with Ajax Code: VM1166:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1 ![]() I do not understand where the pre ![]() RE: Ajax & Class Output - jreklund - 01-21-2018 That's just auto generated HTML by Google Chrome. You need to open the page that got your AJAX request, and there open up Network tab. Select your /json/ url and select Response. That's the real response from the server. RE: Ajax & Class Output - Wertos - 01-21-2018 If you look at the network tab, then the responses from the server are identical. {"html":"","stop":"false","start":0} - This output class {"html":"","stop":"false","start":0} - This echo It is visible even that the text differs. RE: Ajax & Class Output - dave friend - 01-21-2018 How are you handling the response from the ajax call? Please show the javascript and the portion of html is manipulates. RE: Ajax & Class Output - Wertos - 01-21-2018 Code: $.ajax({ RE: Ajax & Class Output - jreklund - 01-21-2018 You need to specify that you want json and ignore parsing. Code: $.ajax({ RE: Ajax & Class Output - Wertos - 01-21-2018 Yes, it worked, but I had to remove the line Code: JSON.parse(data); In the "callback" is returned already an array. Thank you ! It's decided. |