How to reload a web page on CodePen full page view by clicking a button

后端 未结 1 742
谎友^
谎友^ 2020-12-22 12:35
$(\"#quoteButton\").on(\"click\", function() {
    location.reload();
});

I worked on a \'Random Quote Machine\' from Free Code Camp web site via N

相关标签:
1条回答
  • 2020-12-22 13:32

    This is an alternative to location.reload.

    The parameter of go is the page index, in this case, 0 is the current page.
    For instance, go(-2) would go 2 pages back in the history.

    $("#quoteButton").on("click", function() {
        history.go(0);
    });
    
    0 讨论(0)
提交回复
热议问题