I’ve got a site that’s relatively simple. The user performs some action on the page, and some javascript runs… after it runs, it calls:
window.location.href = window.location.href;
… to refresh the page.
It seemed to work fine, tested in android emulator’s browser.
However, when QA deploys in their environment, it’s not… the page doesn’t reload. There’s no querystring or anything of that sort, mostly just static html and javascript/jquery.
I’ve used my emulator to test mine and the qa site as well as qa’s emulator to test both. In both circumstances, it’s just the qa server that exhibits this problem… I’ve also used a normal desktop browser to test both sites (ie, chrome, ff), and the behavior is consistent.
So, I’m wondering, is there anything on the server that could cause this kind of behavior?
Use
window.location.reload(true);instead. This forces the page to be reloaded from the server. Your code can result in the behavior that the browser caches the page and doesn’t fetch the page from the server again.