我页面中的元素不够快速刷新

Good Morning!!

I have a page, which displays data from mysql table. The process is as follows:

The page basically displays one record at a time with Prev and Next buttons that allows the user to go forwards and backwards.

  1. The user edits/updates fields.
  2. User clicks the Update button, a php script runs an update query. (jquery $.post is used)
  3. Then another $.post is run to retrieve the saved data from the table and it is JSONed to update the elements where the data is displayed on the webpage.

All this is working fine and the tables are updated correctly. HOWEVER, the issue I am having is that the elements sometimes do not show the updated values. If I go to the Next record and then click Prev, I see the new values!

I have tried adding a delay of 2 seconds but sometimes that also does not work.

Can anyone help?

    function on_click3(){   //update answer desc
var modal_confirm=document.getElementById('popup5');
modal_confirm.style.display="block";
yesno5.onclick=function(){
    var x1=$("#cur_value").text();
    $.post("../php/post_text_answer_update_query.php",{ ll_val:x1, ss_q:ad.value});
    var xsender="4";
    $.post("../php/get_after_edit.php",{ ll_val:x1, sender1:xsender},function(data)
    {
        pdata=JSON.parse(data);
        $("#ades").text(pdata);
        xmodal_on();
        nextt();
        prevv();
        xmodal_off();    
    });

    $("#popup4").remove(); 
    $("#popup5").remove(); 
    }
yesno6.onclick=function(){
    $("#popup5").remove();
    $("#popup4").remove(); 
}

}