无法在phonegap中包含/使用inAppBrowser

时间:2016-03-20 22:08:25

标签: android cordova phonegap-plugins

我已经看了其他问题,但没有一个解决方案有效

这是我的代码行:

cordova.InAppBrowser.open(url, target, options);

这是错误:

cordova is not defined(如果我删除代码中的cordova,则为InAppBrowser is not defined

以下是 config.xml 包含:

(...)  
<gap:plugin name="org.apache.cordova.inappbrowser"  />
(...)
<access origin="*"/>
 <feature name="InAppBrowser">
  <param name="android-package" value="org.apache.cordova.InAppBrowser"/>
</feature>
<feature name="InAppBrowser">
    <param name="ios-package" value="CDVInAppBrowser" />
</feature>
(...)

没有做更多的事情。我没有在 Windows 10 上通过cordova plugin (...)命令安装,因为命令行界面中有'cordova' is not recognized as an internal or external command, operable program or batch file.。我已经安装了Phonegap。我想我明白了我所缺少的东西,但我了解我应该如何在Windows中做到这一点。有人可以帮助我到那儿吗? Tyvm! :)

1 个答案:

答案 0 :(得分:0)

我使用它并做了类似的事情。

    var ref = window.open('http://mylink.com','_blank','location=yes','closebuttoncaption=Return');

这里有一个参考: https://cordova.apache.org/docs/en/2.9.0/cordova/inappbrowser/inappbrowser.html