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 8395229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:14:52+00:00 2026-06-09T20:14:52+00:00

Ive been using this code to make use of the indexedDB api. Works fine

  • 0

Ive been using this code to make use of the indexedDB api. Works fine in FF 14. But in Chrome (v.21), im getting some errors. At the moment im having trouble with my createObjectStore command:

db.createObjectStore(objectStoreName, { keyPath: 'id', autoIncrement: true });

Is it because Chrome is using a different spec than FF? Does some methods still differ?

Thanks

this.init = function (successCallback) {

        var openRequest = indexedDB.open(dbName);

        openRequest.onupgradeneeded = function (e) {

            db = e.target.result;

            if (!db.objectStoreNames.contains(objectStoreName)) {
                console.log('Create objectstore');
                db.createObjectStore(objectStoreName, { keyPath: 'id', autoIncrement: true });
            }

            successCallback(e);

        };

        openRequest.onsuccess = function (e) {

            db = e.target.result;

            db.onerror = function (event) {
                console.log("Database error: " + event.target.errorCode);
            };

            successCallback(e);

        };

    };
  • 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-06-09T20:14:53+00:00Added an answer on June 9, 2026 at 8:14 pm

    What is the error you get?

    Difference between FF and chrome is that FF uses the onupgradeneeded callback and chrome the setVersion method to change the database structure

    var req = indexedDB.open("name");
    req.onsuccess = function(e){
        var db = req.result.db;
        var upgradereq = db.setVersion("1")
        upgradereq.onsuccess = function(event){
           upgradereq.result.db.createObjectStore("objectStoreName");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using this: str2 = str1.replace(/[^\w]/gi, ''); It works fine, but falls foul
I am a newbie to graphics. I've been using this code to make thumbnails
So I've been using this code to automatically serialize my User business object which
I've been using MassTransit for handling e-mail messages. Using this code: http://meandaspnet.blogspot.com/2009/10/how-to-binary-serialize-mailmessage-for.html I'm able
To change the language on my website I've been using ressources and this code:
Ok, I've got this code that I've been using to spit out news to
I've been using the sample code from this d3 project to learn how to
I've recently been working with code that looks like this: using namespace std; class
I've been using this script for a long time and it works perfectly in
I've been using this technique for getting the absolute physical path of the running

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.