Android webview “location.replace” 不起作用

js解决方法:

function locationReplace(url){
  if(history.replaceState){
    history.replaceState(null, document.title, url);
    history.go(0);
  }else{
     location.replace(url);
  }
}

出处是stackoverflow,其他方法还有就是原生客户端的解决方法,地址:https://stackoverflow.com/questions/14333620/android-webview-location-replace-doesnt-work

posted @ 2018-06-11 16:32  全玉  阅读(2322)  评论(0编辑  收藏  举报