I am debugging this ajax for quite a time now. I have this on my jQUery file:
$(\"#typeForm\").ajaxForm({
success : function(html){
alert(html);
How about convert all the potential problem characters instead of just what fixes the problem in this circumstance:
die(json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE));
http://php.net/manual/en/function.json-encode.php
http://php.net/manual/en/json.constants.php