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

214
Views
Is it possible to display json response on a web page?

So i made a async/await request and wanted to output the response in json format: I first tried to use alert to alert the response, it displayed the response in an alert box. Then i tried logging it to the console, and it did the same thing in the console. Then i tried displaying it to the webpage using the HTML DOM and interesting things happened. Instead of displaying the response to the webpage, it displayed [object Object].

Now i am curious: Can you actually display json response to the webpage?

Btw this is how my request looks like:

async function syncf() {
  try {
    const response = await fetch("https://reqres.in/api/users/2")
    if (response.ok) {
      const jsonResponse = await response.json()
      document.getElementById("response").innerHTML = jsonResponse
    }
  } catch(error) {
    console.log(error)
  }
}

syncf()
about 4 years ago · Juan Pablo Isaza
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!