Phonegap插件只能在index.html中使用

时间:2017-06-11 12:28:44

标签: javascript jquery html phonegap-plugins phonegap

我目前正在开发Phonegap中的复杂应用程序。 我想使用插件“phonegap-plugin-barcodescanner”,它在index.html中运行良好,在add.html文件中,它不起作用。当我复制index.html并调用其重复的index2.html并创建一个从index.html到index2.html的链接时(我使用bootstrap)

<li role="presentation" style="padding: 5px;" onClick="redirect('index2.html')"><a href="#">index2</a></li>

它不再起作用了。

我使用的是最新版本的Phonegap,几天前所有内容都已下载。

如果您需要更多代码,请参阅GitHub回购:https://github.com/niklasApps/GrocerieOrganizer

1 个答案:

答案 0 :(得分:0)

检查add.html文件中的cordova.js参考是“js / cordova.js”,但必须是“cordova.js”。