Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
Create multiple Schema in indexed DB

I am trying to create mutiple schema with indexed db , the scripts that implemented is

    const openDB = () => {
        var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;

        // Create multiple schema
        // Create a dynamic Schema to append data
        var open = indexedDB.open("ExcelExtension", 1);
        open.onupgradeneeded = function () {
            var db = open.result;
            var store_sheet = db.createObjectStore("schema_1", { keyPath: "id" });
            var index = store_sheet.createIndex("NameIndex", ["name.last", "name.first"]);
        };

        open.onupgradeneeded = function () {
            var db2 = open.result;
            var store_sheet2 = db2.createObjectStore("schema_2", { keyPath: "id" });
            var index = store_sheet2.createIndex("NameIndex2", ["name.last", "name.first"]);
        };
    }

//html <button onlick="openDB()> Create DB

what did i do wrong ? there is no error in script but its only reflecting one schema in db

When i check on my database on browser, i can see only one schema was createdenter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Review how event listeners/handlers work in JavaScript. There are generally two ways to register an event handler:

// way 1
thing.onsomeevent = myEventHandler;
// way 2
thing.addEventListener('someevent', myEventHandler)

Most of the time it does not matter which syntax you use because most of the time you are only registering one event handler.

However, sometimes there is a big difference. The difference between the two methods is that when you have multiple event handlers, in the property assignment approach it overwrites all event handlers registered with one event handler. In the second way, it does not overwrite.

You can only register multiple event handlers using the add event listener syntax.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda