Cordova - window.history.back() not working on HTML back button in iOS 9

前端 未结 6 1557
失恋的感觉
失恋的感觉 2020-12-05 21:48

In my application I am using window.history.back to navigate back to previous View

Declaration of back button

 <         


        
6条回答
  •  情深已故
    2020-12-05 22:31

    Try this

    if(r){
             try{
              var nav = window.navigator;
              if( this.phonegapNavigationEnabled && nav && nav.app && nav.app.backHistory )
              {
                nav.app.backHistory();
              }
              else 
              {
                window.history.back();
              }
            }
            catch(e)
            {
             alert(e);
            }
          }
    

提交回复
热议问题