我工作的離子項目,這是我的app.jsapp.js:未捕獲的語法錯誤:缺少)後的參數列表
var db = null;
angular.module('starter', ['ionic','starter.controllers', 'ngCordova'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
db = $cordovaSQLite.openDB("my.db", location: 0, iosDatabaseLocation: 'Default');
$cordovaSQLite.execute(db,
"CREATE TABLE IF NOT EXISTS contacts(id integer primary key, firstname text, lastname text, mobile number, email text)");
} else {
db = openDatabase("my.db", '1.0', "My WebSql ", 2*1024*1024);
db.transaction(function(tx) {
tx.executeSql("CREATE TABLE IF NOT EXISTS contacts(id integer primary key, firstname text, lastname text, mobile number, email text"));
}
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
的錯誤是
app.js:11 Uncaught SyntaxError: missing) after argument list missing) in line 11
這裏是第11行:
db = $cordovaSQLite.openDB("my.db", location: 0, iosDatabaseLocation: 'Default');
我檢查了所有支架,沒有丟失一個 哪裏出了問題
這是讓它工作,謝謝 – sawcs
沒問題:)記得標記爲答案。 – praetoriaen