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

201
Views
How to display JSON.stringify to HTML as values

I have tried to fetch data using json, and it worked as I wanted to. But the problem is how can I display it on my page or HTML? what I am getting is [{"name":"Black wall"},{"name":"Green wall"},{"name":"Gray wall"}] so How can I make it formal and just display Black wall, Green wall, Gray wall. Is there a way to do this?

$(function(){
    $(".checkBoxClass").on("click", function() {
        var data = [];
        $("table > tbody > tr").each(function () {
        var $tr = $(this);
        if ($tr.find(".checkBoxClass").is(":checked")) {
            data.push({
            name: $tr.find(".name").text(),
            });
        }
        });
        console.clear();
        var messages = JSON.stringify(data);
        console.log(messages);
    });
});
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Basic array map() with join()

var data = [{"name":"Black wall"},{"name":"Green wall"},{"name":"Gray wall"}];

console.log(data.map(function(obj){ return obj.name; }).join(", "));

about 4 years ago · Juan Pablo Isaza Report

0

One of the ways that you can convert results to your format:

const myResult = [{"name":"Black wall"},{"name":"Green wall"},{"name":"Gray wall"}];

const myItems= myResult.map( (item)=> {
    return item.name;
});

console.log(myItems.join(','))

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!