我正在尝试通过PhoneGap使用iOS上的Facebook滑块菜单。问题是我无法在sqlite中插入数据,单击“保存”按钮时出现此错误:
"Uncaught ReferenceError: cordova is not defined".
这是来源:
<!DOCTYPE html>
<html>
<head>
<title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="../../css/index.css" />
<script type="text/javascript" src="../../js/SQLitePlugin.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device ready");
}
function insert() {
console.log("Run1");
var db = window.sqlitePlugin.openDatabase({
name: "PHR.db"
});
db.transaction(function(tx) {
tx.executeSql(
'CREATE TABLE IF NOT EXISTS SignUp (firstname VARCHAR,lastname VARCHAR,email VARCHAR, password VARCHAR ,question1 VARCHAR, answer1 VARCHAR,question2 VARCHAR,answer2 VARCHAR, question3 VARCHAR,answer3 VARCHAR)'
);
});
db.transaction(function(tx) { …Run Code Online (Sandbox Code Playgroud)