Because reload()
needs window.location
as this
. In other words – it is a method of window.location
. When you say:
var fun = window.location.reload;
fun();
You are calling reload()
function without any this
reference (or with implicit window
reference).
This should work:
setTimeout(window.location.reload.bind(window.location), 250);
The window.location.reload.bind(window.location)
part means: take window.location.reload
function and return a function that, when called, will use window.location
as this
reference inside reload()
.