Refresh a div with jQuery

前端 未结 4 1323
無奈伤痛
無奈伤痛 2021-01-20 03:27

Is it possible to refresh a single div with jQuery? I have a button that does logout a user. After the button is clicked, I want to show the login form, so I need to re-pars

4条回答
  •  无人共我
    2021-01-20 04:13

    I'd try:

    $('#logoutbtn').on('click', function () {    
        $.ajax({  
            type: "POST",  
            url: "php/logout.php"
        })
        .done(function(data){
            $('#signup > h3').html('Please ');
        });
    })
    

    The same approach could be used for the login action to prevent the page from having to refresh.

提交回复
热议问题