i have a form with input type="file". it submits using ajax (plugin jquery form). Server returns json response. There are html tags in json data:
{"logs":"<span>vfdvf<\/span>","errors":"<span><\/span>"}
but when plugin gets this response it transferred in
{"logs":"<span>vfdvf<\/span>","errors":"<span><\/span>"}</span></span>
it is not correnct json. How can i fix it? If there is no input type="file" element in form, all works fine.
Here is JS
$('#edit_ext_table_form').ajaxForm({
dataType: 'html',
success: function(responseText) {
console.log(responseText);
},
error: function(request) {
var responseText=request.responseText;
console.log(responseText);
}
}
Here is PHP
$a = array(
'logs' => '<span>vfdvf</span>',
'errors' => '<span></span>',
);
exit(json_encode($a));