this php:
$token = NoCSRF::generate( 'csrf_token' );
$status = "succeed";
$message = "Update done!";
$return = array($status,$message,$token);
//header('Content-type: application/json');
echo json_encode($return);
returns
"↵["succeed","Update done!","MTQ0NDcxNzM3Nm9nUTRCVzRKOXc5RXFocUZodXh5eXo4Tm5waTlzZ05a"]"
to the browser which js can't handle.
If I uncomment the header line in the php it returns
["succeed", "Update done!", "MTQ0NDcxNzIyNnAwY01LMVZHdXV6TE1ZT3FZZHhpd2JZcnM0RTl0Rm81"]
and works OK
Any idea what's going on here? I can't just leave the header line uncommented because this solution doesn't work on the live hosted site although it does my dev site as above...