页面跳转 并将改页面从历史栈中删除

//**本页面是 A 要跳转到../myIndent/myIndent.html页面**
if(history.replaceState){
		    history.replaceState(null, document.title, '../myIndent/myIndent.html?app=' + apps);
			history.go(0);
		} else {
		   location.replace('../myIndent/myIndent.html?app=' + apps);
		}
//../myIndent/myIndent.html 是要跳转的页面 这样写 历史栈中会没有A页面的存在  所以历史返回是返回不到A页面的

这种写法是因为 在安卓手机上 有历史返回按钮 有些场景是 不需要返回某页面 所以在跳转的时候用该方法 当前的页面就不会存在 在历史栈中

这里重点说一下 是当前页面不会存在历史栈中 不是跳转到的那个页面 具体什么原理这里就不阐述了 可以上网查看一下 原理

猜你喜欢

转载自blog.csdn.net/j244233138/article/details/106527445