简体   繁体   English

Cordova:未捕获的ReferenceError:未使用chbrody的SQLitePlugin.js定义PhoneGap

[英]Cordova: Uncaught ReferenceError: PhoneGap is not defined using SQLitePlugin.js by chbrody

I'm using cordova-2.0.0 and the SQLite Plugin from chbrody on Android.(https://github.com/chbrody/Cordova-SQLitePlugin) 我在Android上使用了cordova-2.0.0和chbrody的SQLite插件。(https://github.com/chbrody/Cordova-SQLitePlugin)

My js-imports are 我的js-imports是

<script type="text/javascript" charset="utf-8" src="js/cordova-2.0.0.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/SQLitePlugin.js"></script>

The js-Error occurs in this line of the SQLitePlugin.js: 在SQLitePlugin.js的这一行中发生了js-Error:

return PhoneGap.exec(success, error, "SQLitePlugin", "open", [this.dbPath]);

I checked and found that the Framework object is no longer called "PhoneGap" but is renamed to "cordova". 我检查并发现Framework对象不再被称为“PhoneGap”,而是重命名为“cordova”。 Renaming the object in the Plugin js to "cordova" does not work for me either. 将插件js中的对象重命名为“cordova”对我来说也不起作用。

After the error occurs the database is created as defined, but the js error still occurs in the log. 发生错误后,将按定义创建数据库,但日志中仍会出现js错误。

Any help appreciated! 任何帮助赞赏!

PhoneGap bridge project is now named Cordova officially. PhoneGap桥项目现在正式命名为Cordova。 I advise you to update the SQLLite Library and be sure than you're using the last object name in your code. 我建议你更新SQLLite库,并确保你在代码中使用最后一个对象名。

The last version of SQLLite Plugin looks updated for cordova : https://github.com/brodyspark/PhoneGap-SQLitePlugin-iOS https://github.com/brodyspark/PhoneGap-SQLitePlugin-Android 最新版本的SQLLite插件看起来更新了cordova: https//github.com/brodyspark/PhoneGap-SQLitePlugin-iOS https://github.com/brodyspark/PhoneGap-SQLitePlugin-Android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM