Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:42:42+00:00 2026-05-29T10:42:42+00:00

This is my Javascript code document.addEventListener(deviceready, onDeviceReady, false); // Populate the database // function

  • 0

This is my Javascript code

 document.addEventListener("deviceready", onDeviceReady, false);

// Populate the database
//
function populateDB(tx) {
    alert("populateDB");
    tx.executeSql('DROP TABLE IF EXISTS DEMO');
    tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
    tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
    tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
}

// Query the database
//
function queryDB(tx) {
    alert("queryDB");
    tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
}

// Query the success callback
//
function querySuccess(tx, results) {
    alert("querySuccess");
    // this will be empty since no rows were inserted.
    console.log("Insert ID = " + results.insertId);
    // this will be 0 since it is a select statement
    console.log("Rows Affected = " + results.rowAffected);
    // the number of rows returned by the select statement
    console.log("Insert ID = " + results.rows.length);
}

// Transaction error callback
//
function errorCB(err) {
    alert("errorCB");
    console.log("Error processing SQL: "+err.code);
}

// Transaction success callback
//
function successCB() {
    alert("successCB");
    var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
    db.transaction(queryDB, errorCB);
}

// PhoneGap is ready
//
function onDeviceReady() {
    alert("onDeviceReady");
    var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
    db.transaction(populateDB, errorCB, successCB);
}

But i am getting this error log

D/DroidGap(1674): DroidGap.loadUrl(file:///android_asset/www/index.html)
D/DroidGap(1674): DroidGap: url=file:///android_asset/www/index.html   baseUrl=file:///android_asset/www/
D/DroidGap(1674): DroidGap.init()
D/SoftKeyboardDetect(1674): Ignore this event
D/SoftKeyboardDetect(1674): Ignore this event
D/dalvikvm(1674): GC_FOR_MALLOC freed 1758 objects / 121720 bytes in 172ms
I/Database(1674): sqlite returned: error code = 14, msg = cannot open file at source   line 25467
D/PhoneGapLog(1674): DroidGap:  onExceededDatabaseQuota estimatedSize: 200000    currentQuota: 0  totalUsedQuota: 0
D/PhoneGapLog(1674): calling quotaUpdater.updateQuota newQuota: 200000
D/PhoneGapLog(1674): INVALID_ACCESS_ERR: DOM Exception 15: A parameter or an operation  was not supported by the underlying object.
D/PhoneGapLog(1674): file:///android_asset/www/index.html: Line 232 :  INVALID_ACCESS_ERR: DOM Exception 15: A parameter or an operation was not supported by the    underlying object.
E/Web Console(1674): INVALID_ACCESS_ERR: DOM Exception 15: A parameter or an operation was not supported by the underlying object. at file:///android_asset/www/index.html:232
D/PhoneGapLog(1674): Error processing SQL: 0
D/PhoneGapLog(1674): file:///android_asset/www/index.html: Line 243 : Error processing SQL: 0

I am using Phonegap version 1.4.0.
Whats the problem here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:42:42+00:00Added an answer on May 29, 2026 at 10:42 am

    According to the Web SQL spec:

    The insertId attribute must return the row ID of the row that the
    SQLResultSet object’s SQL statement inserted into the database, if the
    statement inserted a row. If the statement inserted multiple rows, the
    ID of the last row must be the one returned. If the statement did not
    insert a row, then the attribute must instead raise an
    INVALID_ACCESS_ERR exception.

    Your queryDB method does a SELECT. So, by definition, it can’t insert any rows. Therefore, insertId is not valid in this context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my JavaScript code: <script> function change(name){ var element = document.all.name.value; } </script>
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
I've got this JavaScript/jquery code: $(document).ready(function() { var audioElement = document.createElement('audio'); var secondtrack =
I have this javascript code: $(document).ready(function() { var leftHeight = $('#maincontent').height(); $('#sidemenu').css({'height':leftHeight}); }); This
I'm using this HTML,CSS and Javascript code (in one document together if you want
I made this bookmarklet: javascript:(function(){var s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');document.getElementsByTagName('body')[0].appendChild(s);$('#hldIntMain').hide();$('#fadeBackground').hide();return false;})() Formatted code: // Add in jQuery var
Over 1 hour on this. This is javascript code inside my index.php file. function
<script type=text/javascript> function validate() { if (document.form.price.value.trim() === ) { alert(Please enter a price);
In Javascript I have code like: document.addEventListener("mousedown", mouseDownHandler); and occasionally I might fat finger
The code is as follows: <body> <a href="javascript:;" id="test">hello</a> </body> <script type="text/javascript"> document.getElementById("test").addEventListener("click", function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.