Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
window.sqlitePlugin未定义-但已安装sqlite_Sqlite_Cordova_Cordova Plugins - Fatal编程技术网

window.sqlitePlugin未定义-但已安装sqlite

window.sqlitePlugin未定义-但已安装sqlite,sqlite,cordova,cordova-plugins,Sqlite,Cordova,Cordova Plugins,我已尝试通过cordova sqlite storage安装此插件。我使用框架 看起来插件已经安装,因为当我再次键入install命令时,我看到 C:\Users\User\Desktop\pj>cordova plugin add cordova-sqlite-storage Plugin "cordova-sqlite-storage" already installed on android. Plugin "cordova-sqlite-storage" already insta

我已尝试通过
cordova sqlite storage
安装此插件。我使用框架

看起来插件已经安装,因为当我再次键入install命令时,我看到

C:\Users\User\Desktop\pj>cordova plugin add cordova-sqlite-storage
Plugin "cordova-sqlite-storage" already installed on android.
Plugin "cordova-sqlite-storage" already installed on browser.
Adding cordova-sqlite-storage to package.json
这是我使用sqlite的代码: routes.js

routes = [
  {
    path: '/',
    url: './index.html',
  },
  {
    path: '/drive/',
    url: './pages/drive.html',
    on: {
      pageInit: function (e, page) {
        //db start

          window.sqlitePlugin.echoTest(function() {
            console.log('ECHO test OK');
            alert('ECHO test OK');
          });



          window.sqlitePlugin.selfTest(function() {
            console.log('SELF test OK');
            alert('SELF test OK');
          });

[...]
在控制台里我看到了
TypeError:window.sqlitePlugin未定义

将其添加到index.html中, 但在任何脚本之前:

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="plugins/cordova-sqlite-storage/www/SQLitePlugin.js"></script>
<!-- your other scripts here -->

将此添加到index.html, 但在任何脚本之前:

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="plugins/cordova-sqlite-storage/www/SQLitePlugin.js"></script>
<!-- your other scripts here -->