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

  • Home
  • SEARCH
  • 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 6780773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:32:45+00:00 2026-05-26T16:32:45+00:00

So, I have an odd problem. I’m working with an SQLite database through javascript

  • 0

So, I have an odd problem.
I’m working with an SQLite database through javascript in a web application.
I have a problem with a function that doesn’t get called. Here’s what I have:

var db = window.openDatabase("database", "1.0", "Database",
        200000);
db.transaction(functionIUse, errorCB);

The above code doesn’t work. The functionIUse doesn’t get called. However if I do like this:

var db = window.openDatabase("database", "1.0", "Database",
        200000);
alert('db open');
db.transaction(functionIUse, errorCB);

it suddenly gets called. Can anyone explain this behavior to me? It really has me puzzled.
Obviously I would also like to know how to make it work – Every time.

Thanks.

  • 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-26T16:32:46+00:00Added an answer on May 26, 2026 at 4:32 pm

    Your problem is definitely strange, but I think it has to do with your error callback.

    To test this I created the the following jsfiddle

    var errorCB = function(){
        alert("An Error Occured");
    }
    var functionIUse = function(transaction){
        alert('functionIUse Called');
    }
    var functionIUse2 = function(transaction){
        alert('functionIUse2 Called');
    }
    var db = window.openDatabase("database", "1.0", "Database", 200000);
    alert('Database Has Been Opened');
    db.transaction(functionIUse, errorCB);
    db.transaction(functionIUse, errorCBThatDoesntExist);
    

    When you execute this JavaScript functionIUse gets called but functionIUse2 doesn’t and the only thing that is different is that errorCB exists but errorCBThatDoesntExists does not.

    One thing I might recommend is using a JavaScript framework to help interact with the database like html5sql.js. It can make things much simpler by providing a framework to deal with the asynchronous nature of the HTML5 web database as well as providing clearer and more defined callbacks.

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

Sidebar

Related Questions

I recently encountered an odd problem with RSACryptoServiceProvider.VerifyHash . I have a web application
I have the odd problem that I am not able to open the properties
I have an odd problem with Django. I have a set of objects that
Have an odd problem with a 'Signature Pad I'm building for an employment application...
I have an odd problem. I have a unit test that keeps getting stuck
I have an odd problem. I have a number of C# apps that utilize
I have an odd problem that I've been beating my head into a wall
I have an odd problem that I just can't seem to diagnose, and it
I have an odd problem with the following: function loadTextbox(jsonUrl,divId){ $.getJSON(jsonUrl, function(json) { $('#'
I have a very odd problem with javascript. My code is rather long so

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.