I just want to make a very common thing: Letting a website reload when browser window is resized. But the function behaves very weird.
After having tried the javascript possibility, I switched to jQuery. Without success.
I tried these two versions, one with "reload" and one with "reload()".
This one just triggers the alert without doing anything:
$(window).resize(reload);
function reload() {
document.location.reload(true);
alert("here");
}
And that one just endlessly reloads all the time:
$(window).resize(reload());
function reload() {
document.location.reload(true);
alert("here");
}
The endless reload also occurs when using a javascript eventlistener.