Home > Web Front-end > JS Tutorial > body text

ios return does not automatically refresh the page problem

巴扎黑
Release: 2017-07-22 15:21:58
Original
1941 people have browsed it

In the actual development process, there are big pitfalls in the compatibility of mobile terminals. Android is OK, but ios is not, and ios is OK, and Android is invalid. In this way, the rollback operation of ios will not automatically refresh the page, which is very annoying. !
The common history.back() history.go(-1) are not effective in the ios system.
If you want to achieve the effect of real-time refresh, you only need to add the following js to the page you want to refresh:

$(function () {
var isPageHide = false;
window.addEventListener('pageshow', function () {
if (isPageHide) {
window.location.reload();
}
});
window.addEventListener('pagehide ', function () {
isPageHide = true;
});
})

The above is the detailed content of ios return does not automatically refresh the page problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!