json_encode not working with a html string as value

前端 未结 8 1685
太阳男子
太阳男子 2020-12-03 10:02

I am debugging this ajax for quite a time now. I have this on my jQUery file:

$(\"#typeForm\").ajaxForm({
    success : function(html){
        alert(html);
         


        
8条回答
  •  死守一世寂寞
    2020-12-03 10:39

    You should call only prompt object of your array not all! like below:

    $("#typeForm").ajaxForm({
        success : function(html){
            var obj = $.parseJSON(html);
            alert(obj.prompt);
    }).submit(); 
    

提交回复
热议问题