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

173
Vistas
load json data into editorjs

On my webpage, I have an editorjs. The user types in the information, and it is saved into my mongodb (as JSON). If I want to edit the information, I'm trying to get that information from the database and load it back into the editorjs. I've tried a couple different thing; none of which are working. This is what I have in my editorjs.js file:

const description = data.description; // My JSON that was saved.
console.log(description); // So far so good, console logs just what should be expected.

const editor = new EditorJS({
  holderID: 'editorjs',
  tools: {
    // toolbar configuration here
  },
  data: description // This doesn't work, however if I copy and paste
                    // the data that the console logged from earlier,
                    // it loads correctly into the editorjs
});

// My newest attempt here
editor.isReady.then(() => {
  console.log('ok'); // Works so far
  console.log(description); // Also works, logging the same information as earlier
  editor.render({
    description
  });
}).catch((err) => {
  console.log(err);
});

I'm open to suggestions.

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

0

I said this in the comments but i will say it here so others can see it more clearly when they come to this post. He was missing JSON.parse() to parse the JSON.

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