使用location.replace时,在移动端安卓机器中发现页面并没有被replace只是,做了页面的跳转
解决办法:
function locationReplace(url){
if(history.replaceState){
history.replaceState(null, document.title, url);
history.go(0);
}else{
location.replace(url);
}
}
参考文章:Android webview "location.replace" doesn't work](stackoverflow.com/questions/1…)