【问题标题】:Open external page in InAppBrowser android 2.3 doesn't work在 InAppBrowser android 2.3 中打开外部页面不起作用
【发布时间】:2013-05-24 14:37:52
【问题描述】:

我有这个小问题,在 iOS 中 InAppBrowser 运行良好,但在 android 中没有办法,我打开白名单中的所有外部页面,我放了一个 console.log 来查看是否调用了方法,但这里没有打开我是如何处理的

链接:a href="#" onclick="openInAppBrowser('我的链接);" class="最近">

方法

enter code here

function openInAppBrowser(url){
    console.log('click in app brownser');
    console.log('page: ' + url);
    window.open(encodeURI(url), '_blank', 'location=yes');
}

有什么想法吗?在iOS中可以正常工作,但在android中没有办法,如果有人可以帮助我

【问题讨论】:

  • 您是否在 config.xml 中添加了:<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />?该函数被调用是因为您看到了 console.log() 语句,对吗? logcat 中有关于打开 inAppBrowser 的任何内容吗?什么版本的 Android,什么版本的 Cordova,您在设备上进行测试吗?

标签: android ios cordova inappbrowser


【解决方案1】:

您是否在 webview 上启用了 JavaScript?

http://developer.android.com/guide/webapps/webview.html

 WebView myWebView = (WebView)   findViewById(R.id.webview);
 WebSettings webSettings = myWebView.getSettings();
 webSettings.setJavaScriptEnabled(true)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多