Links: https://www.cnblogs.com/joshua317/p/6163471.html
In mobile WAP, often use window.location.href to jump page, this method in most browsers will not
There is a problem, but the morning test reunion raised a bug: In the Android phone's own browser, this is invalid, and did not jump;
The original code:
Window.location.reload (LOCATION.HREF);
Preliminary judgment may be the problem of caching, the first thought of the solution is to jump after the URL to add a timestamp, tell the browser this is a new request;
Window.location.reload (location.href+ '? Time= ' + (new Date ()). GetTime ());
However, there is no egg to read the next JS document:
The href is a property of the location object, and reload () is the method of the Location object
So for href, you can set a new URL for the property so that the browser reads and displays the contents of the new URL.
For reload (), the current document is reloaded, and if the method does not specify a parameter, or if the parameter is False, it uses the HTTP header if-modified-since to detect whether the document on the server has changed. If the document has changed, reload () will download the document again. If the document does not change, the method will load the document from the cache. This is exactly the same as when the user clicks the browser's Refresh button. If the parameter of the method is set to true, it bypasses the cache and re-downloads the document from the server, regardless of the last modification date of the document. This is exactly the same as when the user presses the refresh button of the browser while holding down shift.
But for the browser in the Android phone, reload just loads the document from the cache, so when you use this method, it is invalid;
The solution is to use LOCATION.HREF instead of reload (), and in later use it is strongly recommended that you use Location.href to refresh or jump
Window.location.href = location.href+ '? Time= ' + ((new Date ()). GetTime ());
Wirelessly location.href or location.reload doesn't work.