reload div after ajax request

前端 未结 3 1694
无人共我
无人共我 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:56

    I think you are trying to reload the header section after login to show the username, logout etc. To do that you have to return the all html from the your ajax method into the "data.success" variable using like json encode.

    your ajax method function () {
        $response = array('success' => 'Your html data come here');
        echo json_encode($response);
        exit(0);
    }
    

提交回复
热议问题