1.微信跳到外链再回来页面不刷新,这个网上有很多解决方案,我也是直接抄的网上的,再贴一遍,下次直接在这里复制
var isPageHide = false;
window.addEventListener("pageshow", function() {
if (isPageHide) {
window.location.reload();
}
});
window.addEventListener("pagehide", function() {
isPageHide = true;
});
2.使用antd-mobile的Model.Alert方法的时候发现在部分IOS机上点击不了确定按钮,百度了一下解决办法,但是解决不了,项目急着上线不能等,没办法就调用系统的alert方法,但是会提示ip信息,所有产品让我隐藏ip,直接贴代码
(function() {
window.alert = function(name) {
var iframe = document.createElement("IFRAME");
iframe.style.display = "none";
iframe.setAttribute("src", "data:text/plain");
document.documentElement.appendChild(iframe);
window.frames[0].window.alert(name);
iframe.parentNode.removeChild(iframe);
};
})();