Phonegap 打开手机浏览器

来源:互联网 发布:淘宝定制款是什么意思 编辑:程序博客网 时间:2024/05/01 02:30
网上查了好多 都不怎么好使,下面这条还算比较靠谱, 不过还是没有解决问题
  1. navigator.app.loadUrl(url,{ openExternal:true });  
  2. The "navigator.app" object is only available on Android. Luckily in the soon to be released 2.3.0 version of PhoneGap you will be able to do:
    window.open("http://www.google.com""_system");
最后查了下官方文档, 问题解决:http://docs.phonegap.com/en/2.3.0/cordova_inappbrowser_inappbrowser.md.html

window.open('http://apache.org', '_System', 'location=yes');


Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.

var ref = window.open(url, target, options);
  • ref: reference to the InAppBrowser window (InAppBrowser)
  • url: the URL to load (String). Call encodeURI() on this if you have Unicode characters in your URL.
  • target: the target to load the URL in (String) (Optional, Default: "_self")

    _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser _blank - always open in the InAppBrowser _system - always open in the system web browser
  • options: options for the InAppBrowser (String) (Optional, Default: "location=yes")

    The options string must not contain any blank space, each feature name and value must be separated by a comma. Only the value below is supported:

        location - set to 'yes' or 'no' to turn the location bar on or off for the InAppBrowser


0 0
原创粉丝点击