values not updated after an ajax response

前端 未结 2 1750
遥遥无期
遥遥无期 2020-11-28 00:15

I am sending some form data via ajax to a php script in the same page. PHP must process the data and show results in the same page.

I am using this syntax for ajax:<

2条回答
  •  攒了一身酷
    2020-11-28 00:35

    Pass the result as parameter to updatechart()

    $.ajax
    ({
        type: "POST",
        url: "",
        data: $("form").serialize(),
        success: function(result)
        {
            updatechart(result);      
        }
    }); 
    

    then access the results via parameter.

    function updatechart(result) {
    //.......
    //.......
    console.log(result);
    }
    

    Hope you're trying something like this.

提交回复
热议问题