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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM