I made a work around as below but i don't like it. I would like to understand why it happened.I'm also afraid to have more problems like that.
$.ajax({
type: "POST",
url: "test.cgi",
data: form_data,
beforeSend: function(){
$("#"+type+"_div").html("<span class='LabelRed12'>Loading , please wait..</span><br/>");
},
complete: function(){
},
success: function(html){
$("#"+type +"_div").html(html);
},
error:function(xhr,err){
if (xhr.readyState == 4) {
if (xhr.status == 200) {
$("#"+type +"_div").html(xhr.responseText);
} else
alert("status is " + request.status);
}
}
});
You problem might be that you don't specify dataType for your ajax request, try adding this :
dataType: 'json'