简体   繁体   中英

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)

My js-imports are

<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:

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". Renaming the object in the Plugin js to "cordova" does not work for me either.

After the error occurs the database is created as defined, but the js error still occurs in the log.

Any help appreciated!

PhoneGap bridge project is now named Cordova officially. I advise you to update the SQLLite Library and be sure than you're using the last object name in your code.

The last version of SQLLite Plugin looks updated for cordova : https://github.com/brodyspark/PhoneGap-SQLitePlugin-iOS https://github.com/brodyspark/PhoneGap-SQLitePlugin-Android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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