Ajax & Class Output |
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 ![]()
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.
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.
How are you handling the response from the ajax call? Please show the javascript and the portion of html is manipulates.
Code: $.ajax({
You need to specify that you want json and ignore parsing.
Code: $.ajax({
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. |
Welcome Guest, Not a member yet? Register Sign In |