Jquery : Refresh/Reload the page on clicking a button

前端 未结 7 2090
独厮守ぢ
独厮守ぢ 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:06

    Use this line simply inside your head with

           window.location.reload(true);
    

    It will load your current page or view.

    0 讨论(0)
  • 2021-01-30 11:07

    simple way can be -

    just href="javascript:location.reload(true);

    your answer is

    location.reload(true);
    

    Thanks

    0 讨论(0)
  • 2021-01-30 11:08

    use window.location.href = url

    0 讨论(0)
  • 2021-01-30 11:10

    Use document.location.reload(true) it will not load page from cache.

    0 讨论(0)
  • 2021-01-30 11:20

    You should use the location.reload(true), which will release the cache for that specific page and force the page to load as a NEW page.

    The true parameter forces the page to release it's cache.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题