Welcome Guest, Not a member yet? Register   Sign In
Ajax & Class Output
#1

I'm trying to give data through an output class
PHP Code:
$this->output
  
->set_content_type('application/json''UTF-8')
 
 ->set_output(json_encode($my_array)); 
[Image: 4f1b6e667fbc98e8b722e1560c8b37f8.png]
As a result I get problems with Ajax
Code:
VM1166:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
   at JSON.parse (<anonymous>)
   at Object.<anonymous> (main.js:260)
   at i (jquery.min.js:2)
   at Object.fireWith [as resolveWith] (jquery.min.js:2)
   at A (jquery.min.js:4)
   at XMLHttpRequest.<anonymous> (jquery.min.js:4)
If I do through the echo...
[Image: 1760d5bf2532194686c928585145b990.png]
I do not understand where the pre  Huh
Reply


Messages In This Thread
Ajax & Class Output - by Wertos - 01-21-2018, 08:01 AM
RE: Ajax & Class Output - by jreklund - 01-21-2018, 08:18 AM
RE: Ajax & Class Output - by Wertos - 01-21-2018, 08:54 AM
RE: Ajax & Class Output - by dave friend - 01-21-2018, 09:22 AM
RE: Ajax &amp; Class Output - by Wertos - 01-21-2018, 09:35 AM
RE: Ajax & Class Output - by jreklund - 01-21-2018, 09:55 AM
RE: Ajax & Class Output - by Wertos - 01-21-2018, 10:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB