Few months ago I posted this answer about how to refresh the page via JavaScript.
I provided a JSFIDDLE DEMO too:
var solutions = [
function () { location.reload(); },
function () { history.go(0); },
function () { location.href = location.href; },
function () { location.href = location.pathname; },
function () { location.replace(location.pathname); },
function () { location.reload(false); },
];
$("[data-func]").on("click", function () {
solutions[parseInt($(this).attr("data-func"))]();
});
Someone noticed that location.reload()
is slower than the other methos. Now I can see the same thing.
Why is it slower? Why the others are faster?