3

I'm using cordova-sqlite-plugin for maintaining a localdatabase for my application. Below is my code:

<script type="text/javascript" src="js/cordova.js"></script>
<script type="text/javascript">
     alert("Running...")
     document.addEventListener("deviceready",function(){
          window.sqlitePlugin.openDatabase({
               name: 'test.db',
               iosDatabaseLocation: 'default'
          }, function(db){
                  alert('Database Created');
     });
</script>

});

Below is the screenshot of the error which I'm getting while running the same on xcode simulator

Error getting while running the script

It will be a great help if anyone can suggest some best possible solution.

1 Answer 1

1

Need to add SQLitePlugin.js also in the HTML like this:

<script type="text/javascript" src="js/cordova.js"></script>
<script type="text/javascript" src="js/SQLitePlugin.js"></script>

SQLitePlugin.js can be found in www folder inside cordova-sqlite-storage plugin folder (cordova-sqlite-plugin->www->SQLitePlugin.js)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.