1
How can I pass a php json to jquery with null values. I have the structure below:
$data1 = null; $data2 = null; $data3 = null;
json_encode(array(
'html'=>$html,
'data1'=>$data1,
'data2'=>$data2,
'data3'=>$data3)
);
The fact of passing null gives an error:
Uncaught Syntaxerror: Unexpected token < in JSON at position 0
PHP use 5.5.12
5.6 works well https://ideone.com/fork/7hsBor. No http://phptester.net/ works with 5.5 and 5.4. Where does this variable come from
$html
?– Sergio
I mount part of html in php and pass via json for the $html variable.
– Bruno Nascimento
Is giving error in Jquery ?
– user46523