reload div after ajax request

前端 未结 3 1707
无人共我
无人共我 2020-12-31 15:44

how i can refresh or reload a div after ajax request? i have this code:

function Register(event) {
event.preventDefault();
    console.log(event);
    $.ajax         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 15:55

    I know this post is old and already answered. But I would Like to add something to it. If you look at the answer of @Sree KS it will load the div on top of the existing div. Which is not ideal. Just run inspect div after the method is completed.

    To avoid this issue use the following code:

    $("#divid").load(" #divid > *");
    

    Hope this will help to anyone who has the same issue.

提交回复
热议问题