Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!