Jquery : Refresh/Reload the page on clicking a button

前端 未结 7 2114
独厮守ぢ
独厮守ぢ 2021-01-30 10:51

I have a button which loads after a ajax call , on clicking i want to reload the page (like i press f5)

I tried

$( \".delegate_update_success\" ).click         


        
7条回答
  •  粉色の甜心
    2021-01-30 11:20

    If your button is loading from an AJAX call, you should use

    $(document).on("click", ".delegate_update_success", function(){
        location.reload(true);
    });
    

    instead of

    $( ".delegate_update_success" ).click(function() {
        location.reload();
    });
    

    Also note the true parameter for the location.reload function.

提交回复
热议问题