在app里面,有时候有跳转到手机浏览器的网页中这样的需求,那么前端用cordova打包的app,怎么实现跳转呢?
cordova有个插件cordova-plugin-inappbrowser
,官方文档:https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/index.html
有一个方法可以实现
cordova.InAppBrowser.open(url, target, options);
当target是_system的时候,就可以实现跳转到app外部了
cordova.InAppBrowser.open('https://mint-ui.github.io/docs/#/zh-cn2', '_system', 'location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭');