PHP
echo '<data><![CDATA[ [{"x":0,"y":0,"src":"images/image.jpg"}] ]]></data>';
JS
$.post( 'getData.php', {}, _onResult );
_onResult = function( result)
{
console.log(result);
}
The above console.log outputs:
( on localhost, using WAMP ):
<data><![CDATA[ [{"x":0,"y":0,"src":"images/image.jpg/"}] ]]></data>
( on web hosting, using LINUX ):
<data><![CDATA[ [{"/x/":0,/"y/":0,/"src/":/"images/image.jpg/"}] ]]></data>
How can I get the same output in the second case?
or
Can I somehow convert the second output to be able to parse it with $.parseJSON ?